forked from TeamSpen210/HammerAddons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
81 lines (71 loc) · 2.33 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
[tool.isort]
sections=["FUTURE", "TYPING", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
known_thirdparty = ["srctools"]
extra_standard_library = ["importlib_resources"]
known_typing = ["typing", "typing_extensions"]
no_lines_before = ["TYPING", "FRAMEWORK", "STDLIB"]
multi_line_output = 5 # hanging grid grouped
line_length = 95
lines_after_imports = 2
use_parentheses = true
order_by_type = true
include_trailing_comma = true
from_first = true
combine_as_imports = true
src_paths = ["src"]
[tool.ruff]
line-length = 127
[tool.ruff.lint]
select = [
"UP", "F", "C4", "ANN", "B", "PIE", "RUF",
"PLC", "PLE", "PLW", # Pylint.
"TCH005", # Empty type-checking block.
]
allowed-confusables = [
"×", # Multiplication sign
]
extend-ignore = [
# Allow *-imports.
"F403",
# name may be undefined, or defined from star imports: module
"F405",
"F841", # Unused local var, detects tuple unpacks.
# Flake8-annotations.
# Type annotations for self & cls are not important.
"ANN101",
"ANN102",
# Allow typing.Any
"ANN401",
# PyLint:
"PLC0414", # import x as x is used for type checking.
"PLC0415", # We use non-toplevel imports to fetch our databases after initialising the classes.
"PLC1901", # Allow compare to empty string, can be more clear.
"PLE1205", # Too many arguments for logging, doesn't handle our format
"PLW0603", # Allow use of global statement.
"PLW2901", # Allow redefining loop var inside the loop.
# Ruff:
"RUF100", # Sometimes use # noqa for other linters
"RUF022", # All not sorted
"RUF023", # Slots not sorted
# Flake8-bugbear:
# Loop control var not used, triggers on unpackings.
"B007",
# Stacklevel parameter required for warnings.warn() - doesn't detect positional args.
"B028",
# Pycodestyle, when out of preview:
"E221", # Allow multiple spaces before operators if we want to align
"E226", # Allow no spaces like "1+1", sometimes useful to indicate precedence
# Pyupgrade:
# Keep using typing types even with __future__.annotations.
"UP006", "UP007",
# Flake8-pie:
# Prefer to use pass in empty functions, even if docstring is present
"PIE790",
# Allow aliases for enum values, used often.
"PIE796",
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
"srctools.math.FrozenVec", "srctools.math.FrozenAngle", "srctools.math.FrozenMatrix",
"typing.cast", "srctools.logger.get_logger",
]