Skip to content

Commit 51833cf

Browse files
Merge branch 'master' into remove-some-per-file-ignores
2 parents 3f03f57 + 1f368da commit 51833cf

File tree

2 files changed

+100
-80
lines changed

2 files changed

+100
-80
lines changed

Diff for: .pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: auto-walrus
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.4.3
19+
rev: v0.4.4
2020
hooks:
2121
- id: ruff
2222
- id: ruff-format
@@ -29,7 +29,7 @@ repos:
2929
- tomli
3030

3131
- repo: https://github.com/tox-dev/pyproject-fmt
32-
rev: "1.8.0"
32+
rev: "2.0.4"
3333
hooks:
3434
- id: pyproject-fmt
3535

@@ -42,7 +42,7 @@ repos:
4242
pass_filenames: false
4343

4444
- repo: https://github.com/abravalheri/validate-pyproject
45-
rev: v0.16
45+
rev: v0.17
4646
hooks:
4747
- id: validate-pyproject
4848

Diff for: pyproject.toml

+97-77
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
[tool.ruff]
2-
lint.ignore = [ # `ruff rule S101` for a description of that rule
3-
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` -- FIX ME
4-
"B905", # `zip()` without an explicit `strict=` parameter -- FIX ME
5-
"EM101", # Exception must not use a string literal, assign to variable first
6-
"EXE001", # Shebang is present but file is not executable -- DO NOT FIX
7-
"G004", # Logging statement uses f-string
8-
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
9-
"PLW060", # Using global for `{name}` but no assignment is done -- DO NOT FIX
10-
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
11-
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
12-
"PT018", # Assertion should be broken down into multiple parts
13-
"S101", # Use of `assert` detected -- DO NOT FIX
14-
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME
15-
"SLF001", # Private member accessed: `_Iterator` -- FIX ME
16-
"UP038", # Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
2+
lint.ignore = [ # `ruff rule S101` for a description of that rule
3+
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` -- FIX ME
4+
"B905", # `zip()` without an explicit `strict=` parameter -- FIX ME
5+
"EM101", # Exception must not use a string literal, assign to variable first
6+
"EXE001", # Shebang is present but file is not executable -- DO NOT FIX
7+
"G004", # Logging statement uses f-string
8+
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
9+
"PLW060", # Using global for `{name}` but no assignment is done -- DO NOT FIX
10+
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
11+
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
12+
"PT018", # Assertion should be broken down into multiple parts
13+
"S101", # Use of `assert` detected -- DO NOT FIX
14+
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME
15+
"SLF001", # Private member accessed: `_Iterator` -- FIX ME
16+
"UP038", # Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
1717
]
18-
lint.select = [ # https://beta.ruff.rs/docs/rules
19-
"A", # flake8-builtins
20-
"ARG", # flake8-unused-arguments
21-
"ASYNC", # flake8-async
22-
"B", # flake8-bugbear
23-
"BLE", # flake8-blind-except
24-
"C4", # flake8-comprehensions
25-
"C90", # McCabe cyclomatic complexity
26-
"DJ", # flake8-django
27-
"DTZ", # flake8-datetimez
28-
"E", # pycodestyle
29-
"EM", # flake8-errmsg
30-
"EXE", # flake8-executable
31-
"F", # Pyflakes
32-
"FA", # flake8-future-annotations
33-
"FLY", # flynt
34-
"G", # flake8-logging-format
35-
"I", # isort
36-
"ICN", # flake8-import-conventions
37-
"INP", # flake8-no-pep420
38-
"INT", # flake8-gettext
39-
"ISC", # flake8-implicit-str-concat
40-
"N", # pep8-naming
41-
"NPY", # NumPy-specific rules
42-
"PD", # pandas-vet
43-
"PGH", # pygrep-hooks
44-
"PIE", # flake8-pie
45-
"PL", # Pylint
46-
"PT", # flake8-pytest-style
47-
"PYI", # flake8-pyi
48-
"RSE", # flake8-raise
49-
"RUF", # Ruff-specific rules
50-
"S", # flake8-bandit
51-
"SIM", # flake8-simplify
52-
"SLF", # flake8-self
53-
"T10", # flake8-debugger
54-
"TD", # flake8-todos
55-
"TID", # flake8-tidy-imports
56-
"UP", # pyupgrade
57-
"W", # pycodestyle
58-
"YTT", # flake8-2020
18+
lint.select = [ # https://beta.ruff.rs/docs/rules
19+
"A", # flake8-builtins
20+
"ARG", # flake8-unused-arguments
21+
"ASYNC", # flake8-async
22+
"B", # flake8-bugbear
23+
"BLE", # flake8-blind-except
24+
"C4", # flake8-comprehensions
25+
"C90", # McCabe cyclomatic complexity
26+
"DJ", # flake8-django
27+
"DTZ", # flake8-datetimez
28+
"E", # pycodestyle
29+
"EM", # flake8-errmsg
30+
"EXE", # flake8-executable
31+
"F", # Pyflakes
32+
"FA", # flake8-future-annotations
33+
"FLY", # flynt
34+
"G", # flake8-logging-format
35+
"I", # isort
36+
"ICN", # flake8-import-conventions
37+
"INP", # flake8-no-pep420
38+
"INT", # flake8-gettext
39+
"ISC", # flake8-implicit-str-concat
40+
"N", # pep8-naming
41+
"NPY", # NumPy-specific rules
42+
"PD", # pandas-vet
43+
"PGH", # pygrep-hooks
44+
"PIE", # flake8-pie
45+
"PL", # Pylint
46+
"PT", # flake8-pytest-style
47+
"PYI", # flake8-pyi
48+
"RSE", # flake8-raise
49+
"RUF", # Ruff-specific rules
50+
"S", # flake8-bandit
51+
"SIM", # flake8-simplify
52+
"SLF", # flake8-self
53+
"T10", # flake8-debugger
54+
"TD", # flake8-todos
55+
"TID", # flake8-tidy-imports
56+
"UP", # pyupgrade
57+
"W", # pycodestyle
58+
"YTT", # flake8-2020
5959
# "ANN", # flake8-annotations # FIX ME?
6060
# "COM", # flake8-commas
6161
# "D", # pydocstyle -- FIX ME?
@@ -71,43 +71,63 @@ lint.select = [ # https://beta.ruff.rs/docs/rules
7171
output-format = "full"
7272
target-version = "py312"
7373

74-
[tool.ruff.lint.mccabe] # DO NOT INCREASE THIS VALUE
75-
max-complexity = 17 # default: 10
74+
[tool.ruff.lint.mccabe] # DO NOT INCREASE THIS VALUE
75+
max-complexity = 17 # default: 10
7676

7777
[tool.ruff.lint.per-file-ignores]
78-
"data_structures/hashing/tests/test_hash_map.py" = ["BLE001"]
79-
"hashes/enigma_machine.py" = ["BLE001"]
80-
"machine_learning/sequential_minimum_optimization.py" = ["SIM115"]
81-
"matrix/sherman_morrison.py" = ["SIM103"]
82-
"other/l*u_cache.py" = ["RUF012"]
83-
"physics/newtons_second_law_of_motion.py" = ["BLE001"]
84-
"project_euler/problem_099/sol1.py" = ["SIM115"]
85-
"sorts/external_sort.py" = ["SIM115"]
78+
"data_structures/hashing/tests/test_hash_map.py" = [
79+
"BLE001",
80+
]
81+
"hashes/enigma_machine.py" = [
82+
"BLE001",
83+
]
84+
"machine_learning/sequential_minimum_optimization.py" = [
85+
"SIM115",
86+
]
87+
"matrix/sherman_morrison.py" = [
88+
"SIM103",
89+
]
90+
"other/l*u_cache.py" = [
91+
"RUF012",
92+
]
93+
"physics/newtons_second_law_of_motion.py" = [
94+
"BLE001",
95+
]
96+
"project_euler/problem_099/sol1.py" = [
97+
"SIM115",
98+
]
99+
"sorts/external_sort.py" = [
100+
"SIM115",
101+
]
86102

87-
[tool.ruff.lint.pylint] # DO NOT INCREASE THESE VALUES
88-
allow-magic-value-types = ["float", "int", "str"]
89-
max-args = 10 # default: 5
90-
max-branches = 20 # default: 12
91-
max-returns = 8 # default: 6
92-
max-statements = 88 # default: 50
103+
[tool.ruff.lint.pylint] # DO NOT INCREASE THESE VALUES
104+
allow-magic-value-types = [
105+
"float",
106+
"int",
107+
"str",
108+
]
109+
max-args = 10 # default: 5
110+
max-branches = 20 # default: 12
111+
max-returns = 8 # default: 6
112+
max-statements = 88 # default: 50
93113

94114
[tool.codespell]
95115
ignore-words-list = "3rt,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
96116
skip = "./.*,*.json,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"
97117

98118
[tool.pytest.ini_options]
99119
markers = [
100-
"mat_ops: mark a test as utilizing matrix operations.",
120+
"mat_ops: mark a test as utilizing matrix operations.",
101121
]
102122
addopts = [
103-
"--durations=10",
104-
"--doctest-modules",
105-
"--showlocals",
123+
"--durations=10",
124+
"--doctest-modules",
125+
"--showlocals",
106126
]
107127

108128
[tool.coverage.report]
109129
omit = [
110130
".env/*",
111-
"project_euler/*"
131+
"project_euler/*",
112132
]
113133
sort = "Cover"

0 commit comments

Comments
 (0)