Add isort and ruff as dev dependencies;

 remove `flake8` dependency (replaced by `ruff`);
change `lint.sh` script to use `isort`, `ruff`, and `black`
This commit is contained in:
2023-03-10 16:57:26 +01:00
parent 601fee0bfc
commit 25cbe8de4b
7 changed files with 47 additions and 13 deletions
+41 -5
View File
@@ -44,10 +44,11 @@ dev = [
"black",
"build",
"coverage[toml]",
"flake8",
"isort",
"mkdocs-material",
"mkdocstrings[python]",
"mypy",
"ruff",
]
[project.urls]
@@ -60,8 +61,8 @@ dependencies = { file = "requirements/common.txt" }
readme = { file = ["README.md"] }
version = {attr = "marshmallow_generic.__version__"}
#########
# Mypy: #
#########################
# Static type checking: #
[tool.mypy]
files = [
@@ -75,8 +76,8 @@ plugins = [
]
#############
# Coverage: #
#######################
# Unit test coverage: #
[tool.coverage.run]
source = [
@@ -99,3 +100,38 @@ exclude_lines = [
omit = [
"tests/*",
]
###############################
# Linting and style checking: #
[tool.ruff]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"D", # pydocstyle
"C", # flake8-comprehensions
"B", # flake8-bugbear
"PL", # pylint
"RUF", # ruff-specific
]
ignore = [
"E501", # Line too long -> handled by black
"D203", # 1 blank line required before class docstring -> D211 is better
"D212", # Multi-line docstring summary should start at the first line -> ugly, D212 is better
]
[tool.ruff.per-file-ignores]
"tests/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D104", # Missing docstring in public package
]
###################
# Import sorting: #
[tool.isort]
profile = "black"
extra_standard_library = ["typing_extensions"]