Skip to content

Commit 487d803

Browse files
Merge pull request #9307 from mr-raj12/bump-ruff-v0.15.0
ruff: bump to v0.15.0, migrate config to tool.ruff.lint, fixes #9305
2 parents 74a9cb0 + 48ca497 commit 487d803

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: chartboost/ruff-action@v1
32+
- uses: astral-sh/ruff-action@v3
3333

3434
security:
3535

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ repos:
44
hooks:
55
- id: black
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.0.287
7+
rev: v0.15.0
88
hooks:
99
- id: ruff

pyproject.toml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ skip-magic-trailing-comma = true
9393
line-length = 120
9494
target-version = "py310"
9595

96+
# Exclude a variety of commonly ignored directories.
97+
exclude = [
98+
".cache",
99+
".eggs",
100+
".git",
101+
".git-rewrite",
102+
".idea",
103+
".mypy_cache",
104+
".ruff_cache",
105+
".tox",
106+
"build",
107+
"dist",
108+
]
109+
110+
[tool.ruff.lint]
96111
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
97112
select = ["E", "F"]
98113

@@ -104,35 +119,20 @@ select = ["E", "F"]
104119
# F811 redef of unused var
105120

106121
# borg code style guidelines:
107-
# Ignoring E203 due to https://github.com/PyCQA/pycodestyle/issues/373.
108-
ignore = ["E203", "F405", "E402"]
122+
ignore = ["F405", "E402"]
109123

110124
# Allow autofix for all enabled rules (when `--fix` is provided).
111-
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
125+
fixable = ["ALL"]
112126
unfixable = []
113127

114-
# Exclude a variety of commonly ignored directories.
115-
exclude = [
116-
".cache",
117-
".eggs",
118-
".git",
119-
".git-rewrite",
120-
".idea",
121-
".mypy_cache",
122-
".ruff_cache",
123-
".tox",
124-
"build",
125-
"dist",
126-
]
127-
128128
# Allow unused variables when underscore-prefixed.
129129
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
130130

131131
# Code style violation exceptions:
132132
# please note that the values are adjusted so that they do not cause failures
133133
# with existing code. if you want to change them, you should first fix all
134134
# ruff failures that appear with your change.
135-
[tool.ruff.per-file-ignores]
135+
[tool.ruff.lint.per-file-ignores]
136136
"scripts/make.py" = ["E501"]
137137
"src/borg/archive.py" = ["E501"]
138138
"src/borg/archiver/help_cmd.py" = ["E501"]
@@ -142,7 +142,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
142142
"src/borg/testsuite/archiver/disk_full_test.py" = ["F811"]
143143
"src/borg/testsuite/archiver/return_codes_test.py" = ["F811"]
144144
"src/borg/testsuite/benchmark_test.py" = ["F811"]
145-
"src/borg/testsuite/platform_test.py" = ["F811"]
145+
"src/borg/testsuite/platform/platform_test.py" = ["F811"]
146146

147147
[tool.pytest.ini_options]
148148
markers = []

0 commit comments

Comments
 (0)