From e5a2714baf3e9eea200b909923efecdbdc22800d Mon Sep 17 00:00:00 2001 From: Bastien Gerard Date: Mon, 29 Mar 2021 21:55:34 +0200 Subject: [PATCH] update doc for isort --- .pre-commit-config.yaml | 2 -- CONTRIBUTING.rst | 8 ++++++-- requirements-dev.txt | 1 - setup.cfg | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87c5e2f5..c34aaafe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,8 +8,6 @@ repos: rev: 3.8.4 hooks: - id: flake8 -# additional_dependencies: -# - flake8-import-order - repo: https://github.com/asottile/pyupgrade rev: v2.7.4 hooks: diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 035ae07a..fb183887 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -35,8 +35,8 @@ Travis runs the tests against the main Python 3.x versions. Style Guide ----------- -MongoEngine's codebase is formatted with `black `_, 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. +MongoEngine's codebase is auto-formatted with `black `_, imports are ordered with `isort `_ +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: @@ -58,6 +58,10 @@ To enable ``pre-commit`` simply run: See the ``.pre-commit-config.yaml`` configuration file for more information 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 ------- diff --git a/requirements-dev.txt b/requirements-dev.txt index ee788e7a..f9d0595f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,5 @@ black flake8 -flake8-import-order pre-commit pytest ipdb diff --git a/setup.cfg b/setup.cfg index ab993d76..04c965f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,6 @@ ignore=E501,F403,F405,I201,I202,W504,W605,W503,B007 exclude=build,dist,docs,venv,venv3,.tox,.eggs,tests max-complexity=47 -application-import-names=mongoengine,tests [tool:pytest] # Limits the discovery to tests directory