Repository navigation
discover generation_*.py in model directories - #50
Conversation
The ten generation_*.py files in transformers hold model implementation code but no pattern in MODELING_PATTERNS matched them, so no rule ever saw them. TRF009 gains the matching prefix and reports the two real cross-model imports this exposes. A full run over transformers goes 40 -> 42 findings, both new ones TRF009, so the rules that gate on AST content are unaffected. Also corrects the leftover "only exemption" claim in the TRF009 changelog entry, which convert_*.py and __init__.py contradict. Closes #49.
|
@askserge review |
There was a problem hiding this comment.
🤗 Serge says:
This PR cleanly widens file discovery to include generation_*.py files in model directories and updates TRF009 to lint them. The change is consistent across mlinter/mlinter.py, mlinter/trf009.py, mlinter/rules.toml, README, docs, and tests. The standalone-repo test sensibly renames its helper from generation_utils.py to sampling_helpers.py to avoid it being misclassified as a model file, and the new TRF009 test verifies that cross-model imports in generation_*.py are flagged. Documentation and changelog prose accurately reflect that modular_*.py is the sole exemption while convert_*.py and __init__.py are out of scope. No correctness issues.
serge v0.1.0 · model: moonshotai/Kimi-K2.7-Code · 10 LLM turns · 12 tool calls · 17.4s · 152685 in / 3847 out tokens
The ten generation_*.py files in transformers hold model implementation code but no pattern in MODELING_PATTERNS matched them, so no rule ever saw them. TRF009 gains the matching prefix and reports the two real cross-model imports this exposes. A full run over transformers goes 40 -> 42 findings, both new ones TRF009, so the rules that gate on AST content are unaffected.
Also corrects the leftover "only exemption" claim in the TRF009 changelog entry, which convert_*.py and init.py contradict.
Closes #49.