TRF028
Model files must carry a complete license header.
| Default | Enabled |
| Scope | Models added on or after 2026-06-20 |
| Source | mlinter/trf028.py |
| Show in terminal | mlinter --rule TRF028 |
What it does
Checks the first 25 lines of modeling_*.py, modular_*.py, configuration_*.py, processing_*.py, image_processing_*.py and video_processing_*.py for a Licensed under the <name> License line followed by every clause of the standard warranty paragraph, from You may obtain a copy of the License at through limitations under the License.. The lines are flattened and lowercased before matching, so wrapping and comment style do not matter. Neither the license name nor the copyright line is checked: BLIP is BSD-3-clause and Sapiens2 carries Meta’s own license, and the copyright year and attribution vary per model.
Why is this bad?
A new model file that ships without the header leaves its provenance ambiguous, and adding it later means touching a file that has already been released. Matching only the words Apache License would accept a header truncated mid-paragraph or mangled by a bad search-and-replace, which is what every header defect in the library actually looks like: bitnet loses the closing limitations under the License., tvp and bridgetower have a stray = before every comma, and minimax_m3_vl stops after the URL.
Example
+# Copyright 2026 The HuggingFace Team. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# ...
"""PyTorch Acme model."""
Suppressing this rule
Add a # trf-ignore: TRF028 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.
