Skip to content

Commit 6c2d4a4

Browse files
committed
fix #417 switch to ruff
1 parent 3ca5348 commit 6c2d4a4

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

pyproject.toml

+31
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ griffe_inherited_docstrings = "*"
7878
black = "*"
7979
ipykernel = "^6.29.4"
8080
mknotebooks = "*"
81+
ruff = "^0.9.6"
8182

8283
[tool.mypy]
8384
exclude = "^(migrations|commands|sandbox|samples|sdk)/"
@@ -101,3 +102,33 @@ pattern = "default-unprefixed"
101102
[build-system]
102103
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
103104
build-backend = "poetry_dynamic_versioning.backend"
105+
106+
[tool.ruff] # https://docs.astral.sh/ruff/settings/#top-level
107+
line-length = 88
108+
exclude = ["**/cassettes/", "**/__snapshots__/"]
109+
src = ["src"]
110+
111+
[tool.ruff.lint] # https://docs.astral.sh/ruff/settings/#lint
112+
select = [
113+
"E", # pycodestyle errors
114+
"W", # pycodestyle warnings
115+
"F", # pyflakes
116+
"I", # isort
117+
# "B", # flake8-bugbear
118+
"B006", # flake8-bugbear: Do not use mutable data structures for argument defaults
119+
"C4", # flake8-comprehensions
120+
"UP", # pyupgrade
121+
]
122+
ignore = [
123+
"E741", # Ambiguous variable name: `I`
124+
"E501", # Line too long
125+
"E402", # Module level import not at top of file
126+
"E712", # not work for pandas
127+
"F811", # FIXME: we relay on it to share fixture across app
128+
]
129+
[tool.ruff.lint.isort]
130+
required-imports = ["from __future__ import annotations"]
131+
132+
[tool.ruff.format] # https://docs.astral.sh/ruff/settings/#format
133+
quote-style = "double" # 引號風格,雙引號是預設值
134+
docstring-code-format = true

0 commit comments

Comments
 (0)