-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
98 lines (90 loc) · 3.01 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
98
[project]
name = "cdedb2"
[tool.ruff]
target-version = "py39"
line-length = 88
preview = true
output-format = "concise"
src = ["cdedb", "tests"]
[tool.ruff.lint]
select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
# "C90", # mccabe # Reports a couple of places of over complex code.
# "I", # isort # Run separately.
# "N", # pep8-naming # Reports a few things most of which make sense to ignore.
# "D", # pydocstyle # A whole bunch of complaints. Should be tackled per file if at all.
"UP", # pyupgrade # Upgrades to new syntax. Mostly autofixable.
"YTT", # flake8-2020 # Detects misuse of `sys.version` for python3.10.
# "ANN", # flake8-annotations # Reports many instances of missing __init__ returns, and a few complicated cases.
# "S", # flake8-bandit # Reports some interesting things but plenty false positives.
# "BLE", # flake8-blind-except # Mostly false positives.
# "B", # flake8-bugbear
# "A", # flake8-builtins # Doesn't report much but seems useful.
"COM", # flake8-commas # Enforces consistent trailing commas. Autofixable.
"PLE", # pylint errrors.
"PLW", # pylint warnings.
"PLC", # pylint conventions.
"PLR", # pylint refactoring suggestions.
"RUF100",
]
ignore = [
"F405", # * import.
"E226", # Whitespace around arithmetic operator.
"E501", # Line too long.
"E731", # Assigning a lambda.
"S101", # Use of assert.
"ANN401", # Use of typing.Any.
"S608", # SQL-Injection vector due to query string construction.
"A003", # Class attributes shadowing builtin.
"TRY003", # Exception message not defined in exception class.
"PLW2901", # redefining for loop variable.
"PLW1641", # non hashable child class.
"PLR09", # Too many things in classes.
"PLR1702", # Too many nested blocks.
"PLR6301", # Method could be static.
"PLR2004", # Magic value comparison.
]
[tool.ruff.lint.per-file-ignores]
"tests/frontend_tests/__init__.py" = ["F401"]
"tests/backend_tests/__init__.py" = ["F401"]
"tests/ldap_tests/__init__.py" = ["F401"]
"tests/other_tests/__init__.py" = ["F401"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-third-party = ["subman"]
known-first-party = ["cdedb", "tests"]
combine-as-imports = true
[tool.mypy]
python_version = "3.11"
show_error_codes = true
#show_error_context = true
enable_error_code = "ignore-without-code"
allow_redefinition = true
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
warn_redundant_casts = true
warn_no_return = true
warn_unreachable = true
warn_unused_ignores = true
#This has way too many false positives, due to CdEDBObject = Dict[str, Any]
#warn_return_any = true
local_partial_types = true
[[tool.mypy.overrides]]
module = [
# general
"icu",
# ldap
"ldaptor.*",
# frontend
"mailmanclient.*",
"graphviz.*",
# tests
"webtest",
"webtest.utils",
]
ignore_missing_imports = true