@@ -78,6 +78,7 @@ griffe_inherited_docstrings = "*"
78
78
black = " *"
79
79
ipykernel = " ^6.29.4"
80
80
mknotebooks = " *"
81
+ ruff = " ^0.9.6"
81
82
82
83
[tool .mypy ]
83
84
exclude = " ^(migrations|commands|sandbox|samples|sdk)/"
@@ -101,3 +102,33 @@ pattern = "default-unprefixed"
101
102
[build-system ]
102
103
requires = [" poetry-core>=1.0.0" , " poetry-dynamic-versioning" ]
103
104
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