-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Adapt ruff config to new structure (#110)
- Loading branch information
1 parent
c710c67
commit 5a5eea6
Showing
3 changed files
with
68 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
fix = true | ||
target-version = "py310" | ||
|
||
[lint] | ||
extend-select = [ | ||
# bugbear | ||
"B", | ||
# comprehensions | ||
"C4", | ||
# mccabe | ||
"C90", | ||
# bandit | ||
"S", | ||
# blind exception | ||
# Bare excepts are caught without this, but this also catches `except Exception: ...`. | ||
"BLE", | ||
# builtins | ||
"A", | ||
# Enforce valid noqa comments. | ||
"RUF100", | ||
# isort | ||
"I", | ||
# pycodestyle | ||
"W", | ||
# pyupgrade | ||
"UP", | ||
# debugger | ||
"T10", | ||
"T20", | ||
# quotes | ||
"Q", | ||
# simplify | ||
"SIM", | ||
# tidy imports | ||
# We use this to only outlaw relative _parent_ imports, other relative imports are OK. | ||
"TID", | ||
] | ||
extend-ignore = [ | ||
# There's no reason to outlaw asserts. | ||
# https://stackoverflow.com/a/68429294/1220706 | ||
"S101", | ||
# Ignore line-length. This is enforced by black, but all cases cannot be handled. | ||
# Ideally we'd only suppress this in generated files. | ||
"E501", | ||
# Allow function calls in argument defaults. | ||
"B008", | ||
] | ||
|
||
[lint.isort] | ||
force-single-line = true | ||
known-first-party = ["immoney", "tests"] | ||
|
||
[lint.mccabe] | ||
max-complexity = 10 | ||
|
||
[lint.flake8-tidy-imports] | ||
ban-relative-imports = "parents" | ||
|
||
[lint.extend-per-file-ignores] | ||
"tests/*" = [ | ||
# Cryptographically safe usage of PRNGs is not relevant in tests. | ||
"S311", | ||
# "Yoda conditions are discouraged", this is dangerous to apply in tests, as it | ||
# destroys some cases that are designed to tests bi-directional equality. | ||
"SIM300", | ||
] |