diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 60a40c0..48dfd4f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,18 @@ python -m piptools compile --output-file=requirements.txt python -m pip install -e ".[dev]" ``` +### How to run a code formatter? + +Run [Black](https://black.readthedocs.io/): + +```sh +# Dry-run, showing what should be rewritten: +python -m black --target-version=py36 --diff . + +# Run code format: +python -m black --target-version=py36 . +``` + ### How to run a linter? Run [Flake8](https://flake8.pycqa.org/): diff --git a/setup.cfg b/setup.cfg index 82b9dc4..7dba044 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,3 +10,6 @@ extend-ignore = # https://github.com/PyCQA/pycodestyle/issues/373 is closed. # https://www.flake8rules.com/rules/E203.html E203, + # Let Black manage line length by ignoring “Line too long (E203)” + # https://www.flake8rules.com/rules/E501.html + E501, diff --git a/setup.py b/setup.py index 5a420c5..eaf1af3 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ requirements = [ ] dev_requirements = [ + "black", "flake8", "pip-tools", ]