mirror of
https://github.com/YunoHost-Apps/django-for-runners_ynh.git
synced 2024-09-03 18:26:16 +02:00
fix code style/fix tools/setup
This commit is contained in:
parent
c81f71b452
commit
84313210dc
3 changed files with 21 additions and 15 deletions
|
@ -10,7 +10,7 @@ trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.py]
|
[*.py]
|
||||||
line_length = 119
|
max_line_length = 100
|
||||||
|
|
||||||
[{Makefile,**.mk}]
|
[{Makefile,**.mk}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
@ -18,4 +18,3 @@ insert_final_newline = false
|
||||||
|
|
||||||
[*.yml]
|
[*.yml]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 4
|
|
||||||
|
|
12
Makefile
12
Makefile
|
@ -1,5 +1,5 @@
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
MAX_LINE_LENGTH := 119
|
MAX_LINE_LENGTH := 100
|
||||||
|
|
||||||
all: help
|
all: help
|
||||||
|
|
||||||
|
@ -28,6 +28,16 @@ update: install-poetry ## update the sources and installation and generate "con
|
||||||
poetry update
|
poetry update
|
||||||
poetry export -f requirements.txt --output conf/requirements.txt
|
poetry export -f requirements.txt --output conf/requirements.txt
|
||||||
|
|
||||||
|
lint: ## Run code formatters and linter
|
||||||
|
poetry run flynt --fail-on-change --line-length=${MAX_LINE_LENGTH} .
|
||||||
|
poetry run isort --check-only .
|
||||||
|
poetry run flake8 .
|
||||||
|
|
||||||
|
fix-code-style: ## Fix code formatting
|
||||||
|
poetry run flynt --line-length=${MAX_LINE_LENGTH} .
|
||||||
|
poetry run black --verbose --safe --line-length=${MAX_LINE_LENGTH} --skip-string-normalization .
|
||||||
|
poetry run isort .
|
||||||
|
|
||||||
tox-listenvs: check-poetry ## List all tox test environments
|
tox-listenvs: check-poetry ## List all tox test environments
|
||||||
poetry run tox --listenvs
|
poetry run tox --listenvs
|
||||||
|
|
||||||
|
|
|
@ -17,21 +17,17 @@ django_yunohost_integration = {version = ">=v0.2.0", extras = ["ynh"]}
|
||||||
psycopg2 = "<2.9" # https://www.psycopg.org/docs/install.html#build-prerequisites
|
psycopg2 = "<2.9" # https://www.psycopg.org/docs/install.html#build-prerequisites
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
bx_py_utils = "*"
|
bx_py_utils = "*" # https://github.com/boxine/bx_py_utils
|
||||||
bx_django_utils = "*"
|
bx_django_utils = "*" # https://github.com/boxine/bx_django_utils
|
||||||
tox = "*"
|
tox = "*"
|
||||||
pytest = "*"
|
pytest = "*"
|
||||||
pytest-cov = "*"
|
pytest-cov = "*"
|
||||||
pytest-django = "*"
|
pytest-django = "*"
|
||||||
pytest-darker = "*" # https://github.com/akaihola/pytest-darker
|
pytest-darker = "*" # https://github.com/akaihola/pytest-darker
|
||||||
pytest-flake8 = "*"
|
|
||||||
pytest-isort = "*"
|
|
||||||
coveralls = "*"
|
coveralls = "*"
|
||||||
isort = "*"
|
isort = "*"
|
||||||
flake8 = "*"
|
flake8 = "*"
|
||||||
flynt = "*"
|
EditorConfig = "*" # https://github.com/editorconfig/editorconfig-core-py
|
||||||
darker = "*" # https://github.com/akaihola/darker
|
|
||||||
pyupgrade = "*"
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0"]
|
||||||
|
@ -89,21 +85,22 @@ addopts = """
|
||||||
--no-cov-on-fail
|
--no-cov-on-fail
|
||||||
--showlocals
|
--showlocals
|
||||||
--darker
|
--darker
|
||||||
--flake8
|
|
||||||
--isort
|
|
||||||
--doctest-modules
|
--doctest-modules
|
||||||
--failed-first
|
--failed-first
|
||||||
--last-failed-no-failures all
|
|
||||||
--new-first
|
--new-first
|
||||||
"""
|
"""
|
||||||
# TODO: --mypy
|
|
||||||
|
|
||||||
|
[tool.coverage.run]
|
||||||
|
omit = [".*"]
|
||||||
|
|
||||||
|
|
||||||
[tool.tox]
|
[tool.tox]
|
||||||
# https://tox.readthedocs.io/en/latest/example/basic.html#pyproject-toml-tox-legacy-ini
|
# https://tox.readthedocs.io/en/latest/example/basic.html#pyproject-toml-tox-legacy-ini
|
||||||
legacy_tox_ini = """
|
legacy_tox_ini = """
|
||||||
[tox]
|
[tox]
|
||||||
isolated_build = True
|
isolated_build = True
|
||||||
envlist = px310,py39,py38,py37
|
envlist = py{37,38,39,310}
|
||||||
skip_missing_interpreters = True
|
skip_missing_interpreters = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
|
Loading…
Reference in a new issue