Skip to content

Commit 8f37c21

Browse files
committed
Update linting rules
1 parent c405100 commit 8f37c21

1 file changed

Lines changed: 32 additions & 22 deletions

File tree

pyproject.toml

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,40 @@ pint = ["pint"]
5555
arrow = ["arrow"]
5656
rich = ["rich"]
5757

58-
[tool.isort]
59-
profile = "black"
60-
6158
[tool.ruff]
62-
select = [
63-
"E", # pycodestyle errors
64-
"W", # pycodestyle warnings
65-
"F", # pyflakes
66-
# "I", # isort
67-
"C", # flake8-comprehensions
68-
"B", # flake8-bugbear
69-
]
59+
# Same as Black.
60+
line-length = 88
61+
indent-width = 4
62+
63+
# Assume Python 3.8
64+
target-version = "py38"
65+
66+
[tool.ruff.lint]
67+
select = ["N", "F", "I", "UP", "PL", "A", "G", "S", "E", "SIM", "B"]
7068
ignore = [
71-
"E501", # line too long, handled by black
72-
"B008", # do not perform function calls in argument defaults
73-
"C901", # too complex
69+
"N818", # Exception name should be named with an Error suffix
7470
]
7571

76-
# Assume Python 3.8.
77-
target-version = "py38"
72+
[tool.ruff.lint.per-file-ignores]
73+
"tests/**.py" = [
74+
"S101", # asserts allowed in tests...
75+
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
76+
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
77+
# The below are debateable
78+
"PLR2004", # Magic value used in comparison, ...
79+
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
80+
]
81+
82+
[tool.ruff.lint.pycodestyle]
83+
max-line-length = 117
84+
85+
[tool.ruff.format]
86+
# Like Black, use double quotes for strings.
87+
quote-style = "double"
88+
# Like Black, indent with spaces, rather than tabs.
89+
indent-style = "space"
90+
# Like Black, respect magic trailing commas.
91+
skip-magic-trailing-comma = false
92+
# Like Black, automatically detect the appropriate line ending.
93+
line-ending = "auto"
7894

79-
[tool.ruff.per-file-ignores]
80-
"tests/test_adapters.py" = ["F403", "F405"]
81-
"tests/test_codec*.py" = ["F403", "F405"]
82-
"tests/test_fields.py" = ["F403", "F405"]
83-
"tests/test_kitchensink.py" = ["F403", "F405"]
84-
"tests/test_mapping.py" = ["F403", "F405"]

0 commit comments

Comments
 (0)