Browse Source

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

pull/14/head
Vincent Adolphe 3 years ago
parent
commit
70ffa2fcd0
  1. 22
      .editorconfig
  2. 5
      Makefile
  3. 16
      pyproject.toml
  4. 39
      setup.cfg

22
.editorconfig

@ -0,0 +1,22 @@ @@ -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

@ -36,6 +36,11 @@ test: @@ -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

@ -0,0 +1,16 @@ @@ -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

@ -0,0 +1,39 @@ @@ -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
Loading…
Cancel
Save
Map all the world