Skip to main content

mlinter

mlinter

A standalone linter for Hugging Face Transformers model integration files — modeling_*.py, modular_*.py, configuration_*.py, processing_*.py, image_processing_*.py, video_processing_*.py and feature_extraction_*.py under src/transformers/models/, plus test_tokenization_*.py under tests/models/. It enforces the structural conventions that keep hundreds of model implementations consistent with each other.

📖 Documentation: https://huggingface.github.io/transformers-mlinter/

The docs site is generated from mlinter/rules.toml, so its rule reference is always in step with the installed rules.

Installation

pip install transformers-mlinter

When working on the transformers repo, mlinter is included in the quality extras:

pip install -e ".[quality]"

Quick start

Run from the root of a transformers checkout:

mlinter                                     # check every model integration file
mlinter --changed-only --base-ref origin/main   # only what you changed
mlinter --list-rules                        # list rules and their default state
mlinter --rule TRF001                       # explain one rule

See the CLI reference for every flag, the Python API, and cache locations.

Documentation map

Page What's there
Home What mlinter checks and why, installation, how rule registration works
Rules All rules, filterable, one page each with examples and exemptions
CLI usage Every flag, output formats, cache, Python API
Suppressing rules # trf-ignore, whole-file directives, cutoff dates, allowlists
Contributing a rule Adding a rule, the add-mlinter-rule skill, constraints on a rule
Releasing The tag-driven release process

Development

git clone https://github.com/huggingface/transformers-mlinter
cd transformers-mlinter
pip install -e ".[dev]"
make test        # pytest under tests/
make lint        # ruff check + format --check
make format      # auto-fix style
make typecheck   # ty on mlinter/

Building the docs site

The rule pages are generated and git-ignored. Building needs the Ruby toolchain once:

cd docs && bundle install && cd ..
make docs         # regenerate rule pages, build the site, check internal links
make docs-serve   # live preview on http://localhost:4000/transformers-mlinter/

License

Apache-2.0. See LICENSE.

Release files for transformers-mlinter 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transformers-mlinter 0.1.3
File Size Uploaded
transformers_mlinter-0.1.3.tar.gz 110.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for transformers-mlinter 0.1.3
File Interpreter ABI Platform
transformers_mlinter-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 244.8 kB

Release files / transformers_mlinter-0.1.3.tar.gz

Download URL transformers_mlinter-0.1.3.tar.gz
Size 110.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fb1cbecb7637fd6fd3b4511ca310424fa6ac8da8ea1be589975e5d58b07b67e4
BLAKE2b-256 checksum
How to use checksums
7b808f3262d7ccdb3791c25533e6f8047bb187dbfa55d67334933e87c53557bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release files / transformers_mlinter-0.1.3-py3-none-any.whl

Download URL transformers_mlinter-0.1.3-py3-none-any.whl
Size 134.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51e1d2c72b9c9fa7cc3ccd24ef4e70b726cd79b35d31c46963e9ab95fa42a85f
BLAKE2b-256 checksum
How to use checksums
a1eb7e5d86c5a831e9c2a0daf42602b44524cd0af5d7784726770db4ce4e70a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page