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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
5d3935a720
commit
cf0bf34276
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user