You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Justin Chu edited this page May 18, 2024
·
10 revisions
In PyTorch, we enforce lint rules on code in order to help us catch common mistakes and enforce a greater degree of uniformity in our codebase than human reviewers can normally enforce.
PyTorch uses lintrunner to execute lints locally and in CI. This provides developers with a single command to run all the linters, and ensures consistency between the CI and local development environments. See the lintrunner repo for more info.
To get started, run the following to install lintrunner. Make sure you are at the root of the PyTorch repo:
pip install lintrunner
lintrunner init
This will install lintrunner on your system and download all the necessary dependencies to run linters locally. Note that this will install new packages with pip and download binaries maintained by the PyTorch team. If you want to see what lintrunner init will install, run lintrunner init --dry-run.
How do I run linters locally?
lintrunner
to lint your local changes (by default, this is your working tree changes and the HEAD commit).