From cf0bf34276a55fe4bde052a1ac7bd3aede01b68a Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Tue, 14 Apr 2026 21:58:16 -0700 Subject: [PATCH] fix(seedgo): short-circuit __init__.py in imports + naming checkers Empty __init__.py files were failing both checkers as false positives: - imports: zero-check result scored 0% and reported "Failed (no details)" - naming: __init__ fails snake_case regex ^[a-z][a-z0-9_]*$ Python package markers don't require imports by convention and cannot be renamed (Python-reserved). Short-circuit both checkers to return PASS for any file named __init__.py. Reported by @devpulse while adding navigator/__init__.py to compass. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../apps/handlers/aipass_standards/imports_check.py | 9 +++++++++ .../apps/handlers/aipass_standards/naming_check.py | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/src/aipass/seedgo/apps/handlers/aipass_standards/imports_check.py b/src/aipass/seedgo/apps/handlers/aipass_standards/imports_check.py index 076aef87..04314277 100644 --- a/src/aipass/seedgo/apps/handlers/aipass_standards/imports_check.py +++ b/src/aipass/seedgo/apps/handlers/aipass_standards/imports_check.py @@ -57,6 +57,15 @@ def check_module(module_path: str, bypass_rules: list | None = None) -> Dict: checks = [] path = Path(module_path) + # Python package marker — no imports required by convention + if path.name == '__init__.py': + return { + 'passed': True, + 'checks': [{'name': 'Package marker', 'passed': True, 'message': '__init__.py — Python package marker, no import checks'}], + 'score': 100, + 'standard': 'IMPORTS' + } + if is_bypassed(module_path, 'imports', bypass_rules=bypass_rules): return { 'passed': True, diff --git a/src/aipass/seedgo/apps/handlers/aipass_standards/naming_check.py b/src/aipass/seedgo/apps/handlers/aipass_standards/naming_check.py index 188e20ce..14cef5aa 100644 --- a/src/aipass/seedgo/apps/handlers/aipass_standards/naming_check.py +++ b/src/aipass/seedgo/apps/handlers/aipass_standards/naming_check.py @@ -146,6 +146,14 @@ def check_file_naming(module_path: str, path: Path) -> Dict: """ filename = path.stem # filename without extension + # Python-reserved package marker — cannot be renamed + if path.name == '__init__.py': + return { + 'name': 'File naming', + 'passed': True, + 'message': '__init__.py (Python-reserved package marker)' + } + # Check if it's the documented exception if filename == 'json_handler' and '/handlers/json/' in module_path: return {