mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-12-18 01:00:15 +00:00
[pre-commit.ci] pre-commit autoupdate (#11402)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.3 → v0.4.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.3...v0.4.4) - [github.com/tox-dev/pyproject-fmt: 1.8.0 → 2.0.4](https://github.com/tox-dev/pyproject-fmt/compare/1.8.0...2.0.4) - [github.com/abravalheri/validate-pyproject: v0.16 → v0.17](https://github.com/abravalheri/validate-pyproject/compare/v0.16...v0.17) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
c599f6c910
commit
1f368da06d
|
@ -16,7 +16,7 @@ repos:
|
||||||
- id: auto-walrus
|
- id: auto-walrus
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.4.3
|
rev: v0.4.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
@ -29,7 +29,7 @@ repos:
|
||||||
- tomli
|
- tomli
|
||||||
|
|
||||||
- repo: https://github.com/tox-dev/pyproject-fmt
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||||
rev: "1.8.0"
|
rev: "2.0.4"
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyproject-fmt
|
- id: pyproject-fmt
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ repos:
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|
||||||
- repo: https://github.com/abravalheri/validate-pyproject
|
- repo: https://github.com/abravalheri/validate-pyproject
|
||||||
rev: v0.16
|
rev: v0.17
|
||||||
hooks:
|
hooks:
|
||||||
- id: validate-pyproject
|
- id: validate-pyproject
|
||||||
|
|
||||||
|
|
182
pyproject.toml
182
pyproject.toml
|
@ -1,61 +1,61 @@
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
lint.ignore = [ # `ruff rule S101` for a description of that rule
|
lint.ignore = [ # `ruff rule S101` for a description of that rule
|
||||||
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` -- FIX ME
|
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` -- FIX ME
|
||||||
"B905", # `zip()` without an explicit `strict=` parameter -- FIX ME
|
"B905", # `zip()` without an explicit `strict=` parameter -- FIX ME
|
||||||
"EM101", # Exception must not use a string literal, assign to variable first
|
"EM101", # Exception must not use a string literal, assign to variable first
|
||||||
"EXE001", # Shebang is present but file is not executable -- DO NOT FIX
|
"EXE001", # Shebang is present but file is not executable -- DO NOT FIX
|
||||||
"G004", # Logging statement uses f-string
|
"G004", # Logging statement uses f-string
|
||||||
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
|
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
|
||||||
"PLW060", # Using global for `{name}` but no assignment is done -- DO NOT FIX
|
"PLW060", # Using global for `{name}` but no assignment is done -- DO NOT FIX
|
||||||
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
|
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
|
||||||
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
|
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
|
||||||
"PT018", # Assertion should be broken down into multiple parts
|
"PT018", # Assertion should be broken down into multiple parts
|
||||||
"S101", # Use of `assert` detected -- DO NOT FIX
|
"S101", # Use of `assert` detected -- DO NOT FIX
|
||||||
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME
|
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME
|
||||||
"SLF001", # Private member accessed: `_Iterator` -- FIX ME
|
"SLF001", # Private member accessed: `_Iterator` -- FIX ME
|
||||||
"UP038", # Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
|
"UP038", # Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
|
||||||
]
|
]
|
||||||
lint.select = [ # https://beta.ruff.rs/docs/rules
|
lint.select = [ # https://beta.ruff.rs/docs/rules
|
||||||
"A", # flake8-builtins
|
"A", # flake8-builtins
|
||||||
"ARG", # flake8-unused-arguments
|
"ARG", # flake8-unused-arguments
|
||||||
"ASYNC", # flake8-async
|
"ASYNC", # flake8-async
|
||||||
"B", # flake8-bugbear
|
"B", # flake8-bugbear
|
||||||
"BLE", # flake8-blind-except
|
"BLE", # flake8-blind-except
|
||||||
"C4", # flake8-comprehensions
|
"C4", # flake8-comprehensions
|
||||||
"C90", # McCabe cyclomatic complexity
|
"C90", # McCabe cyclomatic complexity
|
||||||
"DJ", # flake8-django
|
"DJ", # flake8-django
|
||||||
"DTZ", # flake8-datetimez
|
"DTZ", # flake8-datetimez
|
||||||
"E", # pycodestyle
|
"E", # pycodestyle
|
||||||
"EM", # flake8-errmsg
|
"EM", # flake8-errmsg
|
||||||
"EXE", # flake8-executable
|
"EXE", # flake8-executable
|
||||||
"F", # Pyflakes
|
"F", # Pyflakes
|
||||||
"FA", # flake8-future-annotations
|
"FA", # flake8-future-annotations
|
||||||
"FLY", # flynt
|
"FLY", # flynt
|
||||||
"G", # flake8-logging-format
|
"G", # flake8-logging-format
|
||||||
"I", # isort
|
"I", # isort
|
||||||
"ICN", # flake8-import-conventions
|
"ICN", # flake8-import-conventions
|
||||||
"INP", # flake8-no-pep420
|
"INP", # flake8-no-pep420
|
||||||
"INT", # flake8-gettext
|
"INT", # flake8-gettext
|
||||||
"ISC", # flake8-implicit-str-concat
|
"ISC", # flake8-implicit-str-concat
|
||||||
"N", # pep8-naming
|
"N", # pep8-naming
|
||||||
"NPY", # NumPy-specific rules
|
"NPY", # NumPy-specific rules
|
||||||
"PD", # pandas-vet
|
"PD", # pandas-vet
|
||||||
"PGH", # pygrep-hooks
|
"PGH", # pygrep-hooks
|
||||||
"PIE", # flake8-pie
|
"PIE", # flake8-pie
|
||||||
"PL", # Pylint
|
"PL", # Pylint
|
||||||
"PT", # flake8-pytest-style
|
"PT", # flake8-pytest-style
|
||||||
"PYI", # flake8-pyi
|
"PYI", # flake8-pyi
|
||||||
"RSE", # flake8-raise
|
"RSE", # flake8-raise
|
||||||
"RUF", # Ruff-specific rules
|
"RUF", # Ruff-specific rules
|
||||||
"S", # flake8-bandit
|
"S", # flake8-bandit
|
||||||
"SIM", # flake8-simplify
|
"SIM", # flake8-simplify
|
||||||
"SLF", # flake8-self
|
"SLF", # flake8-self
|
||||||
"T10", # flake8-debugger
|
"T10", # flake8-debugger
|
||||||
"TD", # flake8-todos
|
"TD", # flake8-todos
|
||||||
"TID", # flake8-tidy-imports
|
"TID", # flake8-tidy-imports
|
||||||
"UP", # pyupgrade
|
"UP", # pyupgrade
|
||||||
"W", # pycodestyle
|
"W", # pycodestyle
|
||||||
"YTT", # flake8-2020
|
"YTT", # flake8-2020
|
||||||
# "ANN", # flake8-annotations # FIX ME?
|
# "ANN", # flake8-annotations # FIX ME?
|
||||||
# "COM", # flake8-commas
|
# "COM", # flake8-commas
|
||||||
# "D", # pydocstyle -- FIX ME?
|
# "D", # pydocstyle -- FIX ME?
|
||||||
|
@ -71,27 +71,51 @@ lint.select = [ # https://beta.ruff.rs/docs/rules
|
||||||
output-format = "full"
|
output-format = "full"
|
||||||
target-version = "py312"
|
target-version = "py312"
|
||||||
|
|
||||||
[tool.ruff.lint.mccabe] # DO NOT INCREASE THIS VALUE
|
[tool.ruff.lint.mccabe] # DO NOT INCREASE THIS VALUE
|
||||||
max-complexity = 17 # default: 10
|
max-complexity = 17 # default: 10
|
||||||
|
|
||||||
[tool.ruff.lint.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
"arithmetic_analysis/newton_raphson.py" = ["PGH001"]
|
"arithmetic_analysis/newton_raphson.py" = [
|
||||||
"data_structures/binary_tree/binary_search_tree_recursive.py" = ["BLE001"]
|
"PGH001",
|
||||||
"data_structures/hashing/tests/test_hash_map.py" = ["BLE001"]
|
]
|
||||||
"hashes/enigma_machine.py" = ["BLE001"]
|
"data_structures/binary_tree/binary_search_tree_recursive.py" = [
|
||||||
"machine_learning/sequential_minimum_optimization.py" = ["SIM115"]
|
"BLE001",
|
||||||
"matrix/sherman_morrison.py" = ["SIM103"]
|
]
|
||||||
"other/l*u_cache.py" = ["RUF012"]
|
"data_structures/hashing/tests/test_hash_map.py" = [
|
||||||
"physics/newtons_second_law_of_motion.py" = ["BLE001"]
|
"BLE001",
|
||||||
"project_euler/problem_099/sol1.py" = ["SIM115"]
|
]
|
||||||
"sorts/external_sort.py" = ["SIM115"]
|
"hashes/enigma_machine.py" = [
|
||||||
|
"BLE001",
|
||||||
|
]
|
||||||
|
"machine_learning/sequential_minimum_optimization.py" = [
|
||||||
|
"SIM115",
|
||||||
|
]
|
||||||
|
"matrix/sherman_morrison.py" = [
|
||||||
|
"SIM103",
|
||||||
|
]
|
||||||
|
"other/l*u_cache.py" = [
|
||||||
|
"RUF012",
|
||||||
|
]
|
||||||
|
"physics/newtons_second_law_of_motion.py" = [
|
||||||
|
"BLE001",
|
||||||
|
]
|
||||||
|
"project_euler/problem_099/sol1.py" = [
|
||||||
|
"SIM115",
|
||||||
|
]
|
||||||
|
"sorts/external_sort.py" = [
|
||||||
|
"SIM115",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.ruff.lint.pylint] # DO NOT INCREASE THESE VALUES
|
[tool.ruff.lint.pylint] # DO NOT INCREASE THESE VALUES
|
||||||
allow-magic-value-types = ["float", "int", "str"]
|
allow-magic-value-types = [
|
||||||
max-args = 10 # default: 5
|
"float",
|
||||||
max-branches = 20 # default: 12
|
"int",
|
||||||
max-returns = 8 # default: 6
|
"str",
|
||||||
max-statements = 88 # default: 50
|
]
|
||||||
|
max-args = 10 # default: 5
|
||||||
|
max-branches = 20 # default: 12
|
||||||
|
max-returns = 8 # default: 6
|
||||||
|
max-statements = 88 # default: 50
|
||||||
|
|
||||||
[tool.codespell]
|
[tool.codespell]
|
||||||
ignore-words-list = "3rt,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
|
ignore-words-list = "3rt,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
|
||||||
|
@ -99,17 +123,17 @@ skip = "./.*,*.json,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_n
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
markers = [
|
markers = [
|
||||||
"mat_ops: mark a test as utilizing matrix operations.",
|
"mat_ops: mark a test as utilizing matrix operations.",
|
||||||
]
|
]
|
||||||
addopts = [
|
addopts = [
|
||||||
"--durations=10",
|
"--durations=10",
|
||||||
"--doctest-modules",
|
"--doctest-modules",
|
||||||
"--showlocals",
|
"--showlocals",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.coverage.report]
|
[tool.coverage.report]
|
||||||
omit = [
|
omit = [
|
||||||
".env/*",
|
".env/*",
|
||||||
"project_euler/*"
|
"project_euler/*",
|
||||||
]
|
]
|
||||||
sort = "Cover"
|
sort = "Cover"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user