TRF035

Model files must not silence the linter with # noqa.

   
Default Enabled
Scope Models added on or after 2026-06-20
Source mlinter/trf035.py
Show in terminal mlinter --rule TRF035

What it does

Flags # noqa comments, with or without explicit codes, in modeling_*.py, modular_*.py and configuration_*.py.

Why is this bad?

Model files are ordinary code held to the repo’s lint rules; a suppression there means the underlying issue was left in place, and blanket # noqa also hides every future violation on that line. Reviewers spend threads deleting these on new models, and they cluster in machine-generated code where the generator silenced the linter rather than satisfying it.

Example

-from ...modeling_utils import PreTrainedModel  # noqa: F401
+from ...modeling_utils import PreTrainedModel

Suppressing this rule

Add a # trf-ignore: TRF035 comment on the flagged line or the line directly above it. See Suppressing rules for whole-file directives and when a suppression is the wrong answer.

Allowlisted models

3 models are exempt from TRF035 in mlinter/rules.toml, because they predate the convention and cannot be changed without breaking backward compatibility.

Show the 3 allowlisted models
  • hunyuan_vl
  • nemotron3_5_asr
  • zaya