build(config): ajout fichier de config generaux +regle lint Makefile
Parent
70c87e9864
révision
70ffa2fcd0
|
@ -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
|
5
Makefile
5
Makefile
|
@ -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
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
[tool.black]
|
||||
line-length = 79
|
||||
skip-string-normalization = true
|
||||
exclude = '''
|
||||
/(
|
||||
\.git
|
||||
| venv
|
||||
| venv.*
|
||||
| local
|
||||
| var
|
||||
| migrations
|
||||
| node_modules
|
||||
| assets
|
||||
| staticfiles
|
||||
)/
|
||||
'''
|
|
@ -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
|
Chargement…
Référencer dans un nouveau ticket