Initial commit of Black as a development requirement

This commit is contained in:
coox 2020-05-06 16:28:06 +02:00
parent 2a75a71ba2
commit e95820a2fd
3 changed files with 16 additions and 0 deletions

View file

@ -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/):

View file

@ -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,

View file

@ -5,6 +5,7 @@ requirements = [
]
dev_requirements = [
"black",
"flake8",
"pip-tools",
]