Apply code styles via pre-commit

- Add black and isort for Python styling
- Add doc8 for reStructuredText styling
- Add prettier for css/html/js/md/yaml styling
- Run all styling tools from pre-commit hooks
- Adjust flake8 config for compatibility with black
  (and current Django style)
- Add some other helpful pre-commit hooks
- Update editorconfig to match Django
  (with a few necessary adjustments for Anymail)
- Update `tox -e lint` to run all pre-commit hooks
- Update contributing docs
This commit is contained in:
medmunds
2023-02-06 12:26:46 -08:00
committed by Mike Edmunds
parent 52c7c11312
commit 40891fcb4a
8 changed files with 150 additions and 20 deletions

View File

@@ -51,8 +51,8 @@ Pull requests
Pull requests are always welcome to fix bugs and improve support for ESP and Django features.
* Please include test cases.
* We try to follow the `Django coding style`_
(basically, :pep:`8` with longer lines OK).
* We try to follow the `Django coding style`_.
* If you install `pre-commit`_, most of the style guidelines will be handled automatically.
* By submitting a pull request, you're agreeing to release your changes under under
the same BSD license as the rest of this project.
* Documentation is appreciated, but not required.
@@ -61,6 +61,8 @@ Pull requests are always welcome to fix bugs and improve support for ESP and Dja
.. Intentionally point to Django dev branch for coding docs (rather than Django stable):
.. _Django coding style:
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
.. _pre-commit:
https://pre-commit.com/
Testing