fix code style/fix tools/setup

This commit is contained in:
JensDiemer 2022-09-18 17:35:54 +02:00
parent c81f71b452
commit 84313210dc
3 changed files with 21 additions and 15 deletions

View file

@ -10,7 +10,7 @@ trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
line_length = 119
max_line_length = 100
[{Makefile,**.mk}]
indent_style = tab
@ -18,4 +18,3 @@ insert_final_newline = false
[*.yml]
indent_style = tab
indent_size = 4

View file

@ -1,5 +1,5 @@
SHELL := /bin/bash
MAX_LINE_LENGTH := 119
MAX_LINE_LENGTH := 100
all: help
@ -28,6 +28,16 @@ update: install-poetry ## update the sources and installation and generate "con
poetry update
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
poetry run tox --listenvs

View file

@ -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
[tool.poetry.dev-dependencies]
bx_py_utils = "*"
bx_django_utils = "*"
bx_py_utils = "*" # https://github.com/boxine/bx_py_utils
bx_django_utils = "*" # https://github.com/boxine/bx_django_utils
tox = "*"
pytest = "*"
pytest-cov = "*"
pytest-django = "*"
pytest-darker = "*" # https://github.com/akaihola/pytest-darker
pytest-flake8 = "*"
pytest-isort = "*"
coveralls = "*"
isort = "*"
flake8 = "*"
flynt = "*"
darker = "*" # https://github.com/akaihola/darker
pyupgrade = "*"
EditorConfig = "*" # https://github.com/editorconfig/editorconfig-core-py
[build-system]
requires = ["poetry-core>=1.0.0"]
@ -89,21 +85,22 @@ addopts = """
--no-cov-on-fail
--showlocals
--darker
--flake8
--isort
--doctest-modules
--failed-first
--last-failed-no-failures all
--new-first
"""
# TODO: --mypy
[tool.coverage.run]
omit = [".*"]
[tool.tox]
# https://tox.readthedocs.io/en/latest/example/basic.html#pyproject-toml-tox-legacy-ini
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = px310,py39,py38,py37
envlist = py{37,38,39,310}
skip_missing_interpreters = True
[testenv]