Skip to content

Commit 375868f

Browse files
committed
Fix Ruff usage.
1 parent e6fc571 commit 375868f

File tree

2 files changed

+35
-41
lines changed

2 files changed

+35
-41
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
python -m pip install --upgrade pip
2323
pip install ruff
2424
- name: Run Ruff
25-
run: ruff django_bleach
25+
run: ruff format --check django_bleach
2626

2727
codespell:
2828
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
# Minimum requirements for the build system to execute.
3-
requires = ["setuptools", "wheel"] # PEP 508 specifications.
3+
requires = ["setuptools", "wheel"] # PEP 508 specifications.
44

55
[tool.black]
66
line-length = 79
@@ -9,36 +9,17 @@ target-version = ["py311"]
99
[tool.coverage.run]
1010
branch = true
1111
parallel = true
12-
omit = [
13-
"testproject/**"
14-
]
12+
omit = ["testproject/**"]
1513

1614
[tool.coverage.paths]
17-
source = [
18-
"django_bleach",
19-
".tox/**/site-packages"
20-
]
15+
source = ["django_bleach", ".tox/**/site-packages"]
2116

2217
[tool.coverage.report]
2318
show_missing = true
2419

2520
[tool.ruff]
2621
# https://beta.ruff.rs/docs/configuration/
2722
line-length = 79
28-
select = [
29-
"E", # pycodestyle errors
30-
"W", # pycodestyle warnings
31-
"F", # pyflakes
32-
"I", # isort
33-
"C", # flake8-comprehensions
34-
"B", # flake8-bugbear
35-
"Q", # flake8-quotes
36-
"PLE", # pylint error
37-
"PLR", # pylint refactor
38-
"PLW", # pylint warning
39-
"UP", # pyupgrade
40-
]
41-
4223
exclude = [
4324
".eggs",
4425
".git",
@@ -54,29 +35,42 @@ exclude = [
5435
"testproject",
5536
]
5637

38+
[tool.ruff.lint]
39+
select = [
40+
"E", # pycodestyle errors
41+
"W", # pycodestyle warnings
42+
"F", # pyflakes
43+
"I", # isort
44+
"C", # flake8-comprehensions
45+
"B", # flake8-bugbear
46+
"Q", # flake8-quotes
47+
"PLE", # pylint error
48+
"PLR", # pylint refactor
49+
"PLW", # pylint warning
50+
"UP", # pyupgrade
51+
]
52+
5753
ignore = [
58-
"B006", # Do not use mutable data structures for argument defaults
59-
"B011", # tests use assert False
60-
"B019", # Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
61-
"B905", # `zip()` without an explicit `strict=` parameter
62-
"C901", # too complex functions
63-
"E402", # module level import not at top of file
64-
"E731", # do not assign a lambda expression, use a def
65-
"PLR0911", # Too many return statements
66-
"PLR0912", # Too many branches
67-
"PLR0913", # Too many arguments to function call
68-
"PLR0915", # Too many statements
69-
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
54+
"B006", # Do not use mutable data structures for argument defaults
55+
"B011", # tests use assert False
56+
"B019", # Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
57+
"B905", # `zip()` without an explicit `strict=` parameter
58+
"C901", # too complex functions
59+
"E402", # module level import not at top of file
60+
"E731", # do not assign a lambda expression, use a def
61+
"PLR0911", # Too many return statements
62+
"PLR0912", # Too many branches
63+
"PLR0913", # Too many arguments to function call
64+
"PLR0915", # Too many statements
65+
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
7066
]
7167

72-
[tool.ruff.per-file-ignores]
68+
[tool.ruff.lint.per-file-ignores]
7369
"__init__.py" = [
74-
"F401" # unused-import
70+
"F401", # unused-import
7571
]
7672

77-
[tool.ruff.isort]
73+
[tool.ruff.lint.isort]
7874
combine-as-imports = true
79-
known-first-party = [
80-
"django_bleach",
81-
]
75+
known-first-party = ["django_bleach"]
8276
extra-standard-library = ["dataclasses"]

0 commit comments

Comments
 (0)