Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
02e30ca6
Commit
02e30ca6
authored
Feb 24, 2024
by
Aarni Koskela
Browse files
Upgrade Ruff + configure formatting
parent
fd723b78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
.pre-commit-config.yaml
.pre-commit-config.yaml
+2
-2
pyproject.toml
pyproject.toml
+6
-3
No files found.
.pre-commit-config.yaml
View file @
02e30ca6
repos
:
repos
:
-
repo
:
https://github.com/astral-sh/ruff-pre-commit
-
repo
:
https://github.com/astral-sh/ruff-pre-commit
rev
:
v0.
2.0
rev
:
v0.
3.2
hooks
:
hooks
:
-
id
:
ruff
-
id
:
ruff
args
:
args
:
-
--fix
-
--fix
#
- id: ruff-format
# TODO: enable when the time is right
-
id
:
ruff-format
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
rev
:
v4.5.0
rev
:
v4.5.0
hooks
:
hooks
:
...
...
pyproject.toml
View file @
02e30ca6
...
@@ -8,6 +8,10 @@ src = [
...
@@ -8,6 +8,10 @@ src = [
"tests"
,
"tests"
,
"benchmarking"
"benchmarking"
]
]
target-version
=
"py38"
line-length
=
119
[tool.ruff.lint]
select
=
[
select
=
[
"B"
,
# bugbear: security warnings
"B"
,
# bugbear: security warnings
"E"
,
# pycodestyle
"E"
,
# pycodestyle
...
@@ -17,7 +21,6 @@ select = [
...
@@ -17,7 +21,6 @@ select = [
"UP"
,
# alert you when better syntax is available in your python version
"UP"
,
# alert you when better syntax is available in your python version
"RUF"
,
# the ruff developer's own rules
"RUF"
,
# the ruff developer's own rules
]
]
target-version
=
"py38"
ignore
=
[
ignore
=
[
"B007"
,
# Loop control variable not used within the loop body (TODO: enable)
"B007"
,
# Loop control variable not used within the loop body (TODO: enable)
"B028"
,
# Warning without stacklevel (TODO: enable)
"B028"
,
# Warning without stacklevel (TODO: enable)
...
@@ -30,7 +33,7 @@ ignore = [
...
@@ -30,7 +33,7 @@ ignore = [
]
]
ignore-init-module-imports
=
true
# allow to expose in __init__.py via imports
ignore-init-module-imports
=
true
# allow to expose in __init__.py via imports
[tool.ruff.extend-per-file-ignores]
[tool.ruff.
lint.
extend-per-file-ignores]
"**/__init__.py"
=
["F401"]
# allow unused imports in __init__.py
"**/__init__.py"
=
["F401"]
# allow unused imports in __init__.py
"{benchmarking,tests}/**/*.py"
=
[
"{benchmarking,tests}/**/*.py"
=
[
"B007"
,
"B007"
,
...
@@ -42,7 +45,7 @@ ignore-init-module-imports = true # allow to expose in __init__.py via imports
...
@@ -42,7 +45,7 @@ ignore-init-module-imports = true # allow to expose in __init__.py via imports
"UP030"
,
"UP030"
,
]
]
[tool.ruff.isort]
[tool.ruff.
lint.
isort]
combine-as-imports
=
true
combine-as-imports
=
true
detect-same-package
=
true
detect-same-package
=
true
force-sort-within-sections
=
true
force-sort-within-sections
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment