style(python): ajoute isort pour ordonner les imports
Parent
8b38cf78bd
révision
5492c079fe
8
Makefile
8
Makefile
|
@ -141,4 +141,10 @@ cov: test ### vérifie la couverture de code
|
|||
@echo open htmlcov/index.html
|
||||
|
||||
lint: ### vérifie la syntaxe et le code python
|
||||
$(PYTHON) -m flake8 benevalibre
|
||||
@$(PYTHON) -m flake8 benevalibre \
|
||||
|| 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"
|
||||
|
||||
fix-lint: ### corrige la syntaxe et ordonne les imports python
|
||||
$(PYTHON) -m isort --recursive benevalibre
|
||||
|
|
|
@ -8,6 +8,7 @@ pytest-sugar # https://github.com/Frozenball/pytest-sugar
|
|||
# Code quality
|
||||
# ------------------------------------------------------------------------------
|
||||
flake8 >=3.5.0 # https://github.com/pycqa/flake8
|
||||
isort # https://github.com/timothycrosley/isort
|
||||
pytest-cov # https://github.com/pytest-dev/pytest-cov
|
||||
|
||||
# Django
|
||||
|
|
10
setup.cfg
10
setup.cfg
|
@ -33,3 +33,13 @@ exclude =
|
|||
docs,
|
||||
node_modules
|
||||
max-line-length = 80
|
||||
|
||||
[isort]
|
||||
line_length = 80
|
||||
known_first_party = benevalibre
|
||||
multi_line_output = 3
|
||||
default_section = THIRDPARTY
|
||||
known_django = django
|
||||
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
|
||||
skip_glob = **/migrations/*.py
|
||||
include_trailing_comma = True
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket