update doc for isort

This commit is contained in:
Bastien Gerard 2021-03-29 21:55:34 +02:00
parent ff596fcb7e
commit e5a2714baf
4 changed files with 6 additions and 6 deletions

View File

@ -8,8 +8,6 @@ repos:
rev: 3.8.4 rev: 3.8.4
hooks: hooks:
- id: flake8 - id: flake8
# additional_dependencies:
# - flake8-import-order
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.7.4 rev: v2.7.4
hooks: hooks:

View File

@ -35,8 +35,8 @@ Travis runs the tests against the main Python 3.x versions.
Style Guide Style Guide
----------- -----------
MongoEngine's codebase is formatted with `black <https://github.com/python/black>`_, other tools like MongoEngine's codebase is auto-formatted with `black <https://github.com/python/black>`_, imports are ordered with `isort <https://pycqa.github.io/isort/>`_
flake8 are also used. Those tools will run as part of the CI and will fail in case the code is not formatted properly. and other tools like flake8 are also used. Those tools will run as part of the CI and will fail in case the code is not formatted properly.
To install all development tools, simply run the following commands: To install all development tools, simply run the following commands:
@ -58,6 +58,10 @@ To enable ``pre-commit`` simply run:
See the ``.pre-commit-config.yaml`` configuration file for more information See the ``.pre-commit-config.yaml`` configuration file for more information
on how it works. on how it works.
pre-commit will now run upon every commit and will reject anything that doesn't comply.
You can also run all the checks with ``pre-commit run -a``, this is what is used in the CI.
Testing Testing
------- -------

View File

@ -1,6 +1,5 @@
black black
flake8 flake8
flake8-import-order
pre-commit pre-commit
pytest pytest
ipdb ipdb

View File

@ -2,7 +2,6 @@
ignore=E501,F403,F405,I201,I202,W504,W605,W503,B007 ignore=E501,F403,F405,I201,I202,W504,W605,W503,B007
exclude=build,dist,docs,venv,venv3,.tox,.eggs,tests exclude=build,dist,docs,venv,venv3,.tox,.eggs,tests
max-complexity=47 max-complexity=47
application-import-names=mongoengine,tests
[tool:pytest] [tool:pytest]
# Limits the discovery to tests directory # Limits the discovery to tests directory