mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
Initial commit: reorganized source tree
- backend/: 13 Maven modules (cw-elevator-application, cloudwalk-cloud, intelligent-cwoscomponent, ninca-crk, etc.) - frontend/: 4 Vue projects (elevator-front, cwos-portal, alarm-front, front_acs) + decompiled + scripts - scripts/: build, test-env, tools (Docker Compose, service templates, API parity) - docs/: AGENTS.md, superpowers specs, architecture docs - .gitignore: standard Java/Maven exclusions Moved from legacy maven-*/ root layout to backend/ organized structure.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Scan *.java for block comments in the last N lines (tail noise / orphan */). Read-only."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
TAIL_LINES = 50
|
||||
REPO = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
def main() -> int:
|
||||
suspicious: list[tuple[Path, str]] = []
|
||||
with_slash: list[Path] = []
|
||||
for p in REPO.rglob("*.java"):
|
||||
sp = str(p)
|
||||
if "/target/" in sp:
|
||||
continue
|
||||
try:
|
||||
t = p.read_text(encoding="utf-8", errors="replace")
|
||||
except OSError:
|
||||
continue
|
||||
lines = t.splitlines()
|
||||
if not lines:
|
||||
continue
|
||||
tail = "\n".join(lines[-TAIL_LINES:])
|
||||
if "/*" in tail or "*/" in tail:
|
||||
with_slash.append(p)
|
||||
low = tail.lower()
|
||||
if "location" in low and "/*" in tail:
|
||||
suspicious.append((p, "Location in tail block"))
|
||||
if "jd-core" in low or "jd core" in low:
|
||||
suspicious.append((p, "jd-core in tail"))
|
||||
if "decompil" in low and "/*" in tail:
|
||||
suspicious.append((p, "decompil+block in tail"))
|
||||
# Trailing */ only: last non-empty line is */
|
||||
nonws = [ln for ln in lines[-20:] if ln.strip()]
|
||||
if len(nonws) >= 1 and nonws[-1].strip() == "*/" and "/**" not in "\n".join(lines[-5:]):
|
||||
# might be orphan closer (rare)
|
||||
if "*/" in tail and tail.count("/*") < tail.count("*/"):
|
||||
suspicious.append((p, "possible orphan */ at EOF"))
|
||||
|
||||
print(f"Scanned under {REPO}")
|
||||
print(f"Files with /* or */ in last {TAIL_LINES} lines: {len(with_slash)}")
|
||||
print(f"Flagged suspicious: {len(suspicious)}")
|
||||
for p, reason in suspicious[:80]:
|
||||
print(f" {reason}: {p.relative_to(REPO)}")
|
||||
if len(suspicious) > 80:
|
||||
print(f" ... and {len(suspicious) - 80} more")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user