Skip to content

Commit 3ce8ff9

Browse files
sjvrijnegpbos
authored andcommitted
update deprecated ruff usage and config
1 parent 780e6a4 commit 3ce8ff9

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

{{cookiecutter.directory_name}}/.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ echo "Script $0 triggered ..."
66
echo "Starting ruff analysis..."
77

88
# quietly run ruff
9-
ruff . --fix
9+
ruff check . --fix
1010

1111
# use return code to abort commit if necessary
1212
if [ $? != "0" ]; then

{{cookiecutter.directory_name}}/pyproject.toml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,35 @@ extras = dev
100100
"""
101101

102102
[tool.ruff]
103+
exclude = [
104+
".bzr",
105+
".direnv",
106+
".eggs",
107+
".git",
108+
".hg",
109+
".mypy_cache",
110+
".nox",
111+
".pants.d",
112+
".ruff_cache",
113+
".svn",
114+
".tox",
115+
".venv",
116+
"__pypackages__",
117+
"_build",
118+
"buck-out",
119+
"build",
120+
"dist",
121+
"node_modules",
122+
"venv",
123+
".venv",
124+
"scripts",
125+
]
126+
127+
target-version = "py39"
128+
line-length = 120
129+
130+
131+
[tool.ruff.lint]
103132
# Enable Pyflakes `E` and `F` codes by default.
104133
select = [
105134
"F", # Pyflakes
@@ -137,39 +166,14 @@ ignore = [
137166
fixable = ["A", "B", "C", "D", "E", "F", "I"]
138167
unfixable = []
139168

140-
exclude = [
141-
".bzr",
142-
".direnv",
143-
".eggs",
144-
".git",
145-
".hg",
146-
".mypy_cache",
147-
".nox",
148-
".pants.d",
149-
".ruff_cache",
150-
".svn",
151-
".tox",
152-
".venv",
153-
"__pypackages__",
154-
"_build",
155-
"buck-out",
156-
"build",
157-
"dist",
158-
"node_modules",
159-
"venv",
160-
".venv",
161-
"scripts",
162-
]
163169
per-file-ignores = {}
164170

165171

166172
# Allow unused variables when underscore-prefixed.
167173
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
168174

169-
target-version = "py39"
170-
line-length = 120
171175

172-
[tool.ruff.isort]
176+
[tool.ruff.lint.isort]
173177
known-first-party = ["{{ cookiecutter.package_name }}"]
174178
force-single-line = true
175179
no-lines-before = ["future","standard-library","third-party","first-party","local-folder"]

0 commit comments

Comments
 (0)