fix(arch-010): checker scans full app tree by default and handles relative paths
This commit is contained in:
@@ -200,15 +200,10 @@ def find_python_files(search_path: Path | None = None) -> list[Path]:
|
|||||||
files.append(Path(root) / fname)
|
files.append(Path(root) / fname)
|
||||||
return sorted(files)
|
return sorted(files)
|
||||||
|
|
||||||
# Default: scan both plugin and core directories
|
# Default: scan the whole app/ tree so new subpackages are covered automatically
|
||||||
files: list[Path] = []
|
files: list[Path] = []
|
||||||
scan_dirs = [
|
scan_dirs = [
|
||||||
BUILTINS_DIR,
|
PROJECT_ROOT / "app",
|
||||||
PROJECT_ROOT / "app" / "core",
|
|
||||||
PROJECT_ROOT / "app" / "services",
|
|
||||||
PROJECT_ROOT / "app" / "routes",
|
|
||||||
PROJECT_ROOT / "app" / "commands",
|
|
||||||
PROJECT_ROOT / "app" / "ai",
|
|
||||||
]
|
]
|
||||||
for scan_dir in scan_dirs:
|
for scan_dir in scan_dirs:
|
||||||
if not scan_dir.exists():
|
if not scan_dir.exists():
|
||||||
@@ -229,8 +224,8 @@ def main() -> int:
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--path",
|
"--path",
|
||||||
type=Path,
|
type=Path,
|
||||||
default=BUILTINS_DIR,
|
default=None,
|
||||||
help="Path to check (default: app/plugins/builtins)",
|
help="Path to check (default: full scan of builtins + core dirs)",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--verbose",
|
"--verbose",
|
||||||
@@ -239,6 +234,10 @@ def main() -> int:
|
|||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Resolve user-supplied paths so downstream relative_to(PROJECT_ROOT) works
|
||||||
|
if args.path is not None:
|
||||||
|
args.path = args.path.resolve()
|
||||||
|
|
||||||
files = find_python_files(args.path)
|
files = find_python_files(args.path)
|
||||||
all_violations: list[str] = []
|
all_violations: list[str] = []
|
||||||
checked = 0
|
checked = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user