forked from crowdsecurity/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
156 lines (139 loc) · 5.41 KB
/
Copy pathpyproject.toml
File metadata and controls
156 lines (139 loc) · 5.41 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
[project]
name = "cshub"
version = "0.1.0"
description = "tools to manage index, blockers and lint configuration"
readme = "README.md"
authors = [
{ email = "marco@crowdsec.net" }
]
requires-python = ">=3.12"
dependencies = [
"jsonschema>=4.23.0",
"mdutils>=1.6.0",
"pygithub>=2.6.1",
"python-dateutil>=2.9.0.post0",
"pyyaml>=6.0.2",
"requests>=2.32.3",
"typed-argument-parser>=1.10.1",
]
[project.scripts]
hublint = "cshub.hublint:main"
mkindex = "cshub.mkindex:main"
mkblockers = "cshub.mkblockers:main"
scenario-taxonomy = "cshub.scenario_taxonomy:main"
mitre-db = "cshub.mitre_db:main"
appsec-vpatch-lint = "cshub.appsec_vpatch_lint:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[dependency-groups]
dev = [
"basedpyright>=1.28.1",
"ruff>=0.11.0",
]
[tool.basedpyright]
reportAny = "none"
reportAttributeAccessIssue = "none"
reportConstantRedefinition = "none"
reportImplicitOverride = "none"
reportMissingParameterType = "none"
reportMissingTypeArgument = "none"
reportOptionalMemberAccess = "none"
reportOptionalSubscript = "none"
reportPossiblyUnboundVariable = "none"
reportReturnType = "none"
reportUnannotatedClassAttribute = "none"
reportUninitializedInstanceVariable = "none"
reportUnknownArgumentType = "none"
reportUnknownMemberType = "none"
reportUnknownParameterType = "none"
reportUnknownVariableType = "none"
reportUnnecessaryComparison = "none"
reportUnusedCallResult = "none"
reportUnusedParameter = "none"
reportUnusedVariable = "none"
[tool.ruff]
target-version = "py312"
line-length = 128
[tool.ruff.lint.per-file-ignores]
"src/cshub/appsec_vpatch_lint.py" = [
"B007", # Loop control variable `d` not used within loop body
"COM", # flake8-commas
"PERF401", # Use `list.extend` to create a transformed list
"PLW2901", # `for` loop variable `w` overwritten by assignment target
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM112", # Use capitalized environment variable `...` instead of `...`
]
"src/cshub/hublint.py" = [
"ARG002", # Unused method argument: `...`
"ANN", # Missing type annotations
"B020", # Loop control variable `data` overrides iterable it iterates
"COM", # flake8-commas
"EM102", # Exception must not use an f-string literal, assign to variable first
"ERA001", # Found commented-out code
"FBT002", # Boolean default positional argument in function definition
"FIX002", # Line contains TODO, consider resolving the issue
"FIX003", # Line contains XXX, consider resolving the issue
"S113", # Probable use of `requests` call without timeout
"SLF001", # Private member accessed: `...`
"TD001", # Invalid TODO tag: `...`
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
"TD003", # Missing issue link for this TODO
"TD005", # Missing issue description after `TODO`
"TRY003", # Avoid specifying long messages outside the exception class
"TRY004", # Prefer `TypeError` exception for invalid type
"PLW0603", # Using the global statement to update `...` is discouraged
]
"src/cshub/mitre_db.py" = [
"ANN", # Missing type annotations
"COM", # flake8-commas
"ERA001", # Found commented-out code
"S113", # Probable use of `requests` call without timeout
]
"src/cshub/mkblockers.py" = [
"ANN", # Missing type annotations
"ARG001", # Unused function argument: `...`
"DTZ001", # `datetime.datetime()` called without a `tzinfo` argument
"DTZ005", # `datetime.datetime.now()` called without a `tz` argument
"S113", # Probable use of `requests` call without timeout
]
"src/cshub/mkindex.py" = [
"ANN", # Missing type annotations
"FIX003", # Line contains XXX, consider resolving the issue
"SLOT000", # Subclasses of `str` should define `__slots__`
"TD001", # Invalid TODO tag: `...`
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
"TD003", # Missing issue link for this TODO
]
"src/cshub/scenario_taxonomy.py" = [
"ANN", # Missing type annotations
"ARG001", # Unused function argument: `...`
"B007", # Loop control variable `d` not used within loop body
"BLE001", # Do not catch blind exception: `Exception`
"COM", # flake8-commas
"PERF401", # Use `list.extend` to create a transformed list
"PLR2004", # Magic value used in comparison, consider replacing `...` with a constant variable
"PLW2901", # `for` loop variable `w` overwritten by assignment target
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
"S603", # `subprocess` call: check for execution of untrusted input
"S607", # Starting a process with a partial executable path
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM108", # Use ternary operator `...` instead of `if`-`else`-block
"SIM112", # Use capitalized environment variable `...` instead of `...`
"UP017", # Use `datetime.UTC` alias
]
[tool.ruff.lint]
select = [
"ALL"
]
ignore = [
"D", # pydocstyle
"T201", # `print` found
]
[tool.ruff.lint.pylint]
max-statements = 154
max-branches = 50
max-args = 6
[tool.ruff.lint.mccabe]
max-complexity = 43