switch from flake8 to ruff

This commit is contained in:
Jörg Thalheim 2023-01-16 14:08:54 +01:00
parent 28a0597659
commit 54f99b4998
2 changed files with 27 additions and 5 deletions

20
pyproject.toml Normal file
View File

@ -0,0 +1,20 @@
[tool.ruff]
line-length = 88
select = ["E", "F", "I"]
ignore = [ "E501" ]
[tool.mypy]
python_version = "3.10"
warn_redundant_casts = true
disallow_untyped_calls = true
disallow_untyped_defs = true
no_implicit_optional = true
[[tool.mypy.overrides]]
module = "setuptools.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pytest.*"
ignore_missing_imports = true

View File

@ -4,6 +4,8 @@
direnv,
mypy,
python3,
lib,
ruff
}:
writeScript "run-tests" ''
set -e
@ -11,12 +13,12 @@ writeScript "run-tests" ''
echo run shellcheck
${shellcheck}/bin/shellcheck direnvrc
echo run black
LC_ALL=en_US.utf-8 ${python3.pkgs.black}/bin/black --check .
echo run flake8
${python3.pkgs.flake8}/bin/flake8 --ignore E501 tests
LC_ALL=en_US.utf-8 ${lib.getExe python3.pkgs.black} --check .
echo run ruff
${lib.getExe ruff} tests
echo run mypy
${mypy}/bin/mypy tests
${lib.getExe mypy} tests
echo run unittest
${python3.pkgs.pytest}/bin/pytest .
${lib.getExe python3.pkgs.pytest} .
''