Skip to content

Commit

Permalink
chore: Isolate ruff settings
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam committed Oct 20, 2024
1 parent f2f24d1 commit 543e656
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 56 deletions.
56 changes: 0 additions & 56 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,59 +107,3 @@ markers = [
"external: mark tests that require extra dependencies",
"no_external: mark tests that will fail if run with extra dependencies",
]

[tool.ruff]
fix = true
target-version = "py39"
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",
# print
"T20",
# quotes
"Q",
# return
# This gives 3 false positives, would be nice otherwise probably.
# "RET",
# simplify
"SIM",
# tidy imports
# We use this to only outlaw relative parent imports.
"TID",
]
extend-ignore = [
# There's no reason to outlaw asserts.
# https://stackoverflow.com/a/68429294/1220706
"S101",
]

[tool.ruff.isort]
force-single-line = true
known-first-party = ["phantom", "tests"]

[tool.ruff.mccabe]
max-complexity = 10

[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "parents"
50 changes: 50 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
fix = true
target-version = "py39"

[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",
# print
"T20",
# quotes
"Q",
# return
# This gives 3 false positives, would be nice otherwise probably.
# "RET",
# simplify
"SIM",
# tidy imports
# We use this to only outlaw relative parent imports.
"TID",
]
extend-ignore = [
# There's no reason to outlaw asserts.
# https://stackoverflow.com/a/68429294/1220706
"S101",
]
isort.force-single-line = true
isort.known-first-party = ["phantom", "tests"]
flake8-tidy-imports.ban-relative-imports = "parents"
mccabe.max-complexity = 10

0 comments on commit 543e656

Please sign in to comment.