-
Notifications
You must be signed in to change notification settings - Fork 225
/
pyproject.toml
126 lines (115 loc) · 3.4 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
[tool.pytest.ini_options]
addopts = "-v"
testpaths = [
"src/test",
"src/plugins/**/test",
]
markers = [
"AnalysisPluginTestConfig: Configure the analysis_plugin fixture",
"SchedulerTestConfig: Configure the analysis_scheduler, comparison_scheduler and unpacking_scheduler",
"WebInterfaceUnitTestConfig: Configure the web_interface fixture",
"backend_config_overwrite: Overwrite defaults for the testing backend config",
"common_config_overwrite: Overwrite defaults for the testing common config",
"frontend_config_overwrite: Overwrite defaults for the testing frontend config",
]
[tool.ruff]
exclude = [
".git",
".ruff_cache",
".venv",
"bin",
"node_modules",
"docker", # ingore plugins/*/*/docker/scripts/* jython ghidra scripts
"venv",
"data", # ignore plugins/*/*/test/data/* test data folders (containing test files)
"src/plugins/analysis/input_vectors/internal", # FixMe: runs inside a bionic docker container with python 3.6
]
line-length = 120
target-version = "py38"
[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", # pycodestyle Error
"W", # pycodestyle Warning
"C90", # mccabe
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"PIE", # flake8-pie
"T20", # flake8-print
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PL", # Pylint
"PERF", # Perflint
"RUF", # Ruff-specific rules
]
ignore = [
"A003",
"PERF203",
"PERF401",
"RUF001",
"RUF002",
"RUF003",
"RUF015",
# pydantic only supports these from python>=3.9
"UP006",
"UP007",
# rules may cause conflicts when used with the formatter
"ISC001",
"Q001",
]
fixable = ["ALL"]
[tool.ruff.lint.per-file-ignores]
"test*.py" = ["ARG002", "PLR2004"]
"conftest.py" = ["ARG001", "ARG002"]
"common_helper.py" = ["ARG002"]
# ignore prints in CLI scripts
"migrate_db_to_postgresql.py" = ["T201"]
"manage_users.py" = ["T201"]
"migrate_database.py" = ["T201"]
[tool.ruff.lint.isort]
known-first-party = ["analysis", "compare", "helperFunctions", "install", "intercom", "objects", "plugins", "scheduler",
"statistic", "storage", "test", "unpacker", "version", "web_interface", "config"]
known-third-party = ["docker"]
[tool.ruff.lint.pylint]
max-args=7
max-public-methods = 40
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "single"
docstring-quotes = "double"
[tool.ruff.format]
quote-style = "single"
[tool.coverage.run]
omit = [
# ignore install scripts
"src/install.py",
"src/install/*",
# ignore alembic migration scripts
"src/storage/migration/**",
# ignore files only run inside docker
"src/plugins/analysis/*/docker/**",
]
[tool.coverage.report]
exclude_also = [
# exclude type checking blocks which are not executed during runtime
"if TYPE_CHECKING:",
# also don't complain about abstract methods (as they're also not run)
"@(abc\\.)?abstractmethod",
]