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
Following [my comment here](#7589 (comment)) and [Django's own move to pre-commit](https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#pre-commit-checks).
* Add pre-commit config file to run flake8 and isort.
* Add extra "common sense" hooks.
* Run pre-commit on GitHub actions using the [official action](https://github.com/pre-commit/action/). This is a good way to get up-and-running but it would be better if we activated [pre-commit.ci](https://pre-commit.ci/), which is faster and will auto-update the hooks for us going forwards.
* Remove `runtests.py` code for running linting tools.
* Remove `runtests.py --fast` flag, since that would now just run `pytest -q`, which can be done with `runtests.py -q` instead.
* Remove tox configuration and requirements files for linting.
* Update the contributing guide to mention setting up pre-commit.
See GitHub's [_Fork a Repo_][how-to-fork] Guide for more help.
60
60
61
61
Changes should broadly follow the [PEP 8][pep-8] style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles.
62
+
You can check your contributions against these conventions each time you commit using the [pre-commit](https://pre-commit.com/) hooks, which we also run on CI.
63
+
To set them up, first ensure you have the pre-commit tool installed, for example:
64
+
65
+
python -m pip install pre-commit
66
+
67
+
Then run:
68
+
69
+
pre-commit install
62
70
63
71
## Testing
64
72
@@ -79,18 +87,6 @@ Run using a more concise output style.
79
87
80
88
./runtests.py -q
81
89
82
-
Run the tests using a more concise output style, no coverage, no flake8.
83
-
84
-
./runtests.py --fast
85
-
86
-
Don't run the flake8 code linting.
87
-
88
-
./runtests.py --nolint
89
-
90
-
Only run the flake8 code linting, don't run the tests.
0 commit comments