TheAlgorithms-Python

Форк
0
/
pyproject.toml 
129 строк · 5.0 Кб
1
[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
  "E741",     # Ambiguous variable name 'l' -- FIX ME
6
  "EM101",    # Exception must not use a string literal, assign to variable first
7
  "EXE001",   # Shebang is present but file is not executable -- DO NOT FIX
8
  "G004",     # Logging statement uses f-string
9
  "PLC1901",  # `{}` can be simplified to `{}` as an empty string is falsey
10
  "PLW060",   # Using global for `{name}` but no assignment is done -- DO NOT FIX
11
  "PLW2901",  # PLW2901: Redefined loop variable -- FIX ME
12
  "PT011",    # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
13
  "PT018",    # Assertion should be broken down into multiple parts
14
  "RUF001",   # String contains ambiguous {}. Did you mean {}?
15
  "RUF002",   # Docstring contains ambiguous {}. Did you mean {}?
16
  "RUF003",   # Comment contains ambiguous {}. Did you mean {}?
17
  "RUF007",   # Prefer itertools.pairwise() over zip() when iterating over successive pairs
18
  "S101",     # Use of `assert` detected -- DO NOT FIX
19
  "S113",     # Probable use of requests call without timeout -- FIX ME
20
  "S311",     # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME
21
  "SLF001",   # Private member accessed: `_Iterator` -- FIX ME
22
  "UP038",    # Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
23
]
24
lint.select = [  # https://beta.ruff.rs/docs/rules
25
  "A",      # flake8-builtins
26
  "ARG",    # flake8-unused-arguments
27
  "ASYNC",  # flake8-async
28
  "B",      # flake8-bugbear
29
  "BLE",    # flake8-blind-except
30
  "C4",     # flake8-comprehensions
31
  "C90",    # McCabe cyclomatic complexity
32
  "DJ",     # flake8-django
33
  "DTZ",    # flake8-datetimez
34
  "E",      # pycodestyle
35
  "EM",     # flake8-errmsg
36
  "EXE",    # flake8-executable
37
  "F",      # Pyflakes
38
  "FA",     # flake8-future-annotations
39
  "FLY",    # flynt
40
  "G",      # flake8-logging-format
41
  "I",      # isort
42
  "ICN",    # flake8-import-conventions
43
  "INP",    # flake8-no-pep420
44
  "INT",    # flake8-gettext
45
  "ISC",  # flake8-implicit-str-concat
46
  "N",      # pep8-naming
47
  "NPY",    # NumPy-specific rules
48
  "PD",   # pandas-vet
49
  "PGH",    # pygrep-hooks
50
  "PIE",    # flake8-pie
51
  "PL",     # Pylint
52
  "PT",   # flake8-pytest-style
53
  "PYI",    # flake8-pyi
54
  "RSE",    # flake8-raise
55
  "RUF",    # Ruff-specific rules
56
  "S",      # flake8-bandit
57
  "SIM",    # flake8-simplify
58
  "SLF",    # flake8-self
59
  "T10",    # flake8-debugger
60
  "TD",     # flake8-todos
61
  "TID",    # flake8-tidy-imports
62
  "UP",     # pyupgrade
63
  "W",      # pycodestyle
64
  "YTT",    # flake8-2020
65
  # "ANN",  # flake8-annotations  # FIX ME?
66
  # "COM",  # flake8-commas
67
  # "D",    # pydocstyle -- FIX ME?
68
  # "ERA",  # eradicate -- DO NOT FIX
69
  # "FBT",  # flake8-boolean-trap  # FIX ME
70
  # "PTH",  # flake8-use-pathlib  # FIX ME
71
  # "Q",    # flake8-quotes
72
  # "RET",  # flake8-return  # FIX ME?
73
  # "T20",  # flake8-print
74
  # "TCH",  # flake8-type-checking
75
  # "TRY",  # tryceratops
76
]
77
output-format = "full"
78
target-version = "py312"
79

80
[tool.ruff.lint.mccabe]   # DO NOT INCREASE THIS VALUE
81
max-complexity = 17  # default: 10
82

83
[tool.ruff.lint.per-file-ignores]
84
"arithmetic_analysis/newton_raphson.py" = ["PGH001"]
85
"audio_filters/show_response.py" = ["ARG002"]
86
"data_structures/binary_tree/binary_search_tree_recursive.py" = ["BLE001"]
87
"data_structures/binary_tree/treap.py" = ["SIM114"]
88
"data_structures/hashing/hash_table.py" = ["ARG002"]
89
"data_structures/hashing/quadratic_probing.py" = ["ARG002"]
90
"data_structures/hashing/tests/test_hash_map.py" = ["BLE001"]
91
"data_structures/heap/max_heap.py" = ["SIM114"]
92
"graphs/minimum_spanning_tree_prims.py" = ["SIM114"]
93
"hashes/enigma_machine.py" = ["BLE001"]
94
"machine_learning/decision_tree.py" = ["SIM114"]
95
"machine_learning/linear_discriminant_analysis.py" = ["ARG005"]
96
"machine_learning/sequential_minimum_optimization.py" = ["SIM115"]
97
"matrix/sherman_morrison.py" = ["SIM103", "SIM114"]
98
"other/l*u_cache.py" = ["RUF012"]
99
"physics/newtons_second_law_of_motion.py" = ["BLE001"]
100
"project_euler/problem_099/sol1.py" = ["SIM115"]
101
"sorts/external_sort.py" = ["SIM115"]
102

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

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

114
[tool.pytest.ini_options]
115
markers = [
116
    "mat_ops: mark a test as utilizing matrix operations.",
117
]
118
addopts = [
119
    "--durations=10",
120
    "--doctest-modules",
121
    "--showlocals",
122
]
123

124
[tool.coverage.report]
125
omit = [
126
  ".env/*",
127
  "project_euler/*"
128
]
129
sort = "Cover"
130

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.