-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
97 lines (91 loc) · 3.17 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[tool.poetry]
name = "computer-simulator"
version = "0.1.0"
description = ""
authors = ["Dmitriy Rusinov <[email protected]>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.12"
[tool.poetry.group.dev.dependencies]
coverage = "^7.2.7"
mypy = "^1.4.1"
pytest = "^7.4.0"
pytest-golden = "^0.2.2"
ruff = "^0.1.3"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
enable_assertion_pass_hook = true
addopts = "--doctest-modules"
log_format = "%(levelname)-7s %(module)s:%(funcName)-13s %(message)s"
[tool.ruff]
line-length = 120
select = [
# A set of chosen linter rules is specified here.
# See https://beta.ruff.rs/docs/rules/ for more info.
# pyflakes (simple obvious errors)
"F",
# pycodestyle (style linter, pep8, black-compatible)
"E",
"W",
# pep8-naming (style linter, pep8 naming conventions)
"N",
# isort (imports sorting)
"I",
# mccabe (cyclomatic complexity analyzer to prevent overcomplicated functions)
"C90",
# pyupgrade (possible syntax upgrades checker)
"UP",
# eradicate (commented-out code finder for it to be removed)
"ERA",
# flake8-2020 (errors related to sys.version or sys.version_info, just in case)
"YTT",
# flake8-annotations (enforces presense of type hints so the codebase is fully typed)
# "ANN", # too burdensome
# flake8-async (async-related mistakes/errors)
"ASYNC",
# flake8-builtins (checks builtin names shadowing, it's better not to)
"A",
# flake8-commas (to enforce trailing commas)
"COM",
# flake8-future-annotations (to ensure enabling modern (3.7+) postponed evaluation of type hints)
"FA",
# flake8-import-conventions (to enforce standartized import aliases like "import pandas as pd")
"ICN",
# flake8-no-pep420 (to enforce presence of __init__.py in packages)
"INP",
# flake8-print (to disallow print statements)
"T20",
# flake8-pytest-style (to improve pytest-related style consistency)
"PT",
# flake8-quotes (to enforce quotes style)
"Q",
# flake8-return (checks mistakes related to return values)
"RET",
# flake8-use-pathlib (to enforce pathlib usage instead of os.path)
"PTH",
# pandas-vet (pandas-related advices)
"PD",
# tryceratops (try/except-related advices)
"TRY",
# ruff-specific advices
"RUF",
]
ignore = [
"COM812", # The following rules may cause jconflicts when used with the formatter: `COM812`.
"E501", # allow lines longer than 80 symbols (up to 120)
"T201", # `print` found
"RUF002", # Docstring contains ambiguous `В` (CYRILLIC CAPITAL LETTER VE). Did you mean `B` (LATIN CAPITAL LETTER B)
"RUF003", # Comment contains ambiguous `с` (CYRILLIC SMALL LETTER ES). Did you mean `c` (LATIN SMALL LETTER C)
"PTH123", # `open()` should be replaced by `Path.open()`
# to simplify code for non-Python programmers
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
"UP032", # [*] Use f-string instead of `format` call
]
unfixable = [
"ERA001", # prohibit to "auto-fix" (=remove) commented-out code
]
src = ["src"]
[tool.ruff.mccabe]
max-complexity = 7