style(python): ajoute black pour formatter le code
parent
5492c079fe
commit
951ee64cb8
2
Makefile
2
Makefile
|
@ -145,6 +145,8 @@ lint: ### vérifie la syntaxe et le code python
|
|||
|| echo "\033[31m[flake8]\033[0m Veuillez corriger les erreurs ci-dessus."
|
||||
@$(PYTHON) -m isort --check --recursive benevalibre \
|
||||
|| echo "\033[31m[isort]\033[0m Veuillez corriger l'ordre des imports avec : make isort"
|
||||
@$(PYTHON) -m black --check benevalibre
|
||||
|
||||
fix-lint: ### corrige la syntaxe et ordonne les imports python
|
||||
$(PYTHON) -m isort --recursive benevalibre
|
||||
$(PYTHON) -m black benevalibre
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
[tool.black]
|
||||
line-length = 79
|
||||
skip-string-normalization = true
|
||||
exclude = '''
|
||||
/(
|
||||
\.git
|
||||
| assets
|
||||
| local
|
||||
| migrations
|
||||
| node_modules
|
||||
| var
|
||||
| venv
|
||||
)/
|
||||
| urls(|_.+|/.+).py
|
||||
'''
|
|
@ -7,6 +7,7 @@ pytest-sugar # https://github.com/Frozenball/pytest-sugar
|
|||
|
||||
# Code quality
|
||||
# ------------------------------------------------------------------------------
|
||||
black # https://github.com/python/black
|
||||
flake8 >=3.5.0 # https://github.com/pycqa/flake8
|
||||
isort # https://github.com/timothycrosley/isort
|
||||
pytest-cov # https://github.com/pytest-dev/pytest-cov
|
||||
|
|
Loading…
Reference in New Issue