build(config): ajout fichier de config generaux +regle lint Makefile

pull/14/head
Vincent Adolphe 2019-02-23 00:47:06 +01:00
Parent 70c87e9864
révision 70ffa2fcd0
4 fichiers modifiés avec 82 ajouts et 0 suppressions

22
.editorconfig Normal file
Voir le fichier

@ -0,0 +1,22 @@
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{py,rst,ini}]
indent_style = space
indent_size = 4
[*.{html,css,scss,js,json,yml}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab

Voir le fichier

@ -36,6 +36,11 @@ test:
find . -name "*.py" | xargs grep -nEve '^[[:blank:]]*(#.*|)$$' | grep -Ee 'DBG' ; test ! $$? -eq 0
find . -name "*.html" | xargs grep --color -nEe 'DBG|pdb' ; test ! $$? -eq 0
lint: ### vérifie la syntaxe et le code python
which black > /dev/null && black --check . ; true
$(PYTHON) -m isort --check --recursive . ; true
flake8 .
# backup
dumpdata: backup_dir
$(PYTHON) manage.py dumpdata $(DB1) $(DB2) > backups/backup_db.json

16
pyproject.toml Normal file
Voir le fichier

@ -0,0 +1,16 @@
[tool.black]
line-length = 79
skip-string-normalization = true
exclude = '''
/(
\.git
| venv
| venv.*
| local
| var
| migrations
| node_modules
| assets
| staticfiles
)/
'''

39
setup.cfg Normal file
Voir le fichier

@ -0,0 +1,39 @@
[flake8]
exclude =
.git,
.tox,
venv,
venv*,
*/migrations/*,
*/static/*,
# assets & compilation
assets,
build,
dist,
staticfiles,
node_modules
max-line-length = 80
# isort related: https://github.com/timothycrosley/isort/wiki/isort-Settings[
[isort]
line_length = 79
known_first_party = references, contacts
multi_line_output = 3
default_section = THIRDPARTY
known_django = django
sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
skip_glob = **/migrations/*.py,venv*
include_trailing_comma = True
[coverage:run]
branch = True
include = chronos/*
omit =
chronos/*/migrations/*,
chronos/*/urls.py,
chronos/*tests*,
chronos/settings/*,
chronos/urls.py,
chronos/wsgi.py
[coverage:report]
show_missing = True