forked from pwndbg/pwndbg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
341 lines (288 loc) · 8.71 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
[tool.black]
line-length = 100
[tool.ruff]
line-length = 100
[tool.ruff.lint]
ignore = [
"A003",
"E402",
"E501",
"E731",
"F405",
"F811",
"F821",
"F841",
"W505",
]
select = [
"A", # flake8-builtins
"E", # pycodestyle
"F", # pyflakes
"W", # pycodestyle
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"SLOT", # flake8-slots
"FLY", # flynt
"PGH", # pygrep-hooks
"RET506", # flake8-return: superfluous-else-raise
"RET507", # flake8-return: superfluous-else-continue
"RET508", # flake8-return: superfluous-else-break
# We want to enable the below lints, but they currently return too many errors
# "RET505", # flake8-return: superfluous-else-return
# "SLF" # flake8-self
# "SIM", # flake8-simplify
# "PTH", # flake8-use-pathlib
]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = [
"all",
"bin",
"breakpoint",
"copyright",
"dir",
"exit",
"format",
"hex",
"map",
"max",
"min",
"next",
"type",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.mypy]
strict_optional = false
check_untyped_defs = true
allow_untyped_globals = false
allow_redefinition = true
allow_any_generics = false
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
# warn_return_any = true
# warn_unreachable = true
show_error_context = true
pretty = true
show_error_codes = true
incremental = false
disable_error_code = [
# https://github.com/python/mypy/issues/6232
"assignment"
]
[[tool.mypy.overrides]]
module = [
"pwndbg.disasm.*",
"pwndbg.gdblib.elf",
]
disable_error_code = ["name-defined"]
[[tool.mypy.overrides]]
module = [
"pwndbg.color.*",
"pwndbg.commands.context",
"pwndbg.commands.cymbol",
"pwndbg.commands.hexdump",
"pwndbg.commands.procinfo",
"pwndbg.commands.reload",
"pwndbg.commands.telescope",
"pwndbg.commands.version",
"pwndbg.exception",
"pwndbg.disasm.jump",
"pwndbg.gdblib.dt",
"pwndbg.gdblib.dynamic",
"pwndbg.gdblib.events",
"pwndbg.gdblib.got",
"pwndbg.gdblib.heap_tracking",
"pwndbg.gdblib.stack",
"pwndbg.heap.*",
"pwndbg.hexdump",
"pwndbg.ui",
"pwndbg.wrappers.*",
]
disable_error_code = ["attr-defined"]
[[tool.mypy.overrides]]
module = [
"pwndbg.gdblib.nearpc",
"pwndbg.gdblib.typeinfo",
]
disable_error_code = ["name-defined", "attr-defined"]
[[tool.mypy.overrides]]
module = ["capstone.*", "unicorn.*", "pwnlib.*", "elftools.*", "ipdb.*", "r2pipe", "rzpipe", "rich.*", "pt"]
ignore_missing_imports = true
[tool.isort]
profile = "black"
force_single_line = true
known_third_party = ["capstone", "unicorn", "psutil", "pycparser", "gdb"]
add_imports = "from __future__ import annotations"
[tool.coverage.run]
branch = true
parallel = true
disable_warnings = ["module-not-imported"]
source = ["${SRC_DIR-.}"]
omit = ["ida_script.py"]
data_file = ".cov/coverage"
[tool.coverage.report]
omit = ["ida_script.py", "tests/*"]
[tool.pylint.main]
# Analyse import fallback blocks. This can be used to support both Python 2 and 3
# compatible code, which means that the block might have code that exists only in
# one or another interpreter, leading to false positives when analysed.
analyse-fallback-blocks = true
disable = [
"design", # TODO: disable explicit checks
# basic
"invalid-name",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"pointless-string-statement", # TODO: Fix these
"dangerous-default-value", # TODO: Fix these
# classes
"arguments-renamed",
"protected-access", # TODO: Fix these
"abstract-method", # TODO: Fix these
"attribute-defined-outside-init", # TODO: Fix these
# exceptions
"broad-except",
"raise-missing-from",
# format
"line-too-long",
# imports
"import-outside-toplevel",
"wrong-import-position",
"wildcard-import", # TODO: Fix these
# lambda-expressions
"unnecessary-lambda-assignment",
# miscellaneous
"fixme",
# refactoring
"consider-using-f-string", # TODO: Fix these
"consider-using-with", # TODO: Fix these
"no-else-return", # TODO: Fix these
"no-else-raise", # TODO: Fix these
"no-else-continue", # TODO: Fix these
"no-else-break", # TODO: Fix these
"inconsistent-return-statements", # TODO: Fix these
"redefined-argument-from-local",
# stdlib
"unspecified-encoding",
# typecheck
"no-member",
"keyword-arg-before-vararg",
"assignment-from-none", # TODO: Fix these
# variables
"possibly-unused-variable",
"redefined-outer-name",
"global-statement",
"unused-wildcard-import",
"unused-argument", # TODO: Fix these
"unused-variable", # TODO: Fix these
"undefined-loop-variable", # TODO: Fix these
"undefined-variable", # TODO: Fix these
"redefined-builtin", # TODO: Fix these
]
# Files or directories to be skipped. They should be base names, not paths.
ignore = ["tests", ".git"]
# List of module names for which member attributes should not be checked (useful
# for modules/projects where namespaces are manipulated during runtime and thus
# existing member attributes cannot be deduced by static analysis). It supports
# qualified module names, as well as Unix pattern matching.
ignored-modules = ["gdb", "pt"]
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use, and will cap the count on Windows to
# avoid hangs.
jobs = 0
# Control the amount of potential inferred values when inferring a single object.
# This can help the performance when dealing with large functions or complex,
# nested conditions.
limit-inference-results = 100
# Pickle collected data for later comparisons.
persistent = true
# Minimum Python version to use for version dependent checks. Will default to the
# version used to run pylint.
py-version = "3.7"
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode = true
[tool.pylint.design]
# Maximum number of arguments for function / method.
max-args = 5
# Maximum number of attributes for a class (see R0902).
max-attributes = 7
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr = 5
# Maximum number of branch for function / method body.
max-branches = 12
# Maximum number of locals for function / method body.
max-locals = 15
# Maximum number of parents for a class (see R0901).
max-parents = 7
# Maximum number of public methods for a class (see R0904).
max-public-methods = 20
# Maximum number of return / yield for function / method body.
max-returns = 6
# Maximum number of statements in function / method body.
max-statements = 50
# Minimum number of public methods for a class (see R0903).
min-public-methods = 2
[tool.pylint.format]
# Maximum number of lines in a module.
max-module-lines = 2500 # TODO: Reduce to 1000
[tool.pylint."messages control"]
# Only show warnings with the listed confidence levels. Leave empty to show all.
# Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"]
[tool.pylint.refactoring]
# Maximum number of nested blocks for function / method body
max-nested-blocks = 6
[tool.pylint.reports]
output-format = "colorized"
[tool.poetry]
name = "pwndbg"
description = "Exploit Development and Reverse Engineering with GDB Made Easy"
version = "2024.02.14"
authors = ["Dominik 'disconnect3d' Czarnota <[email protected]>"]
readme = "README.md"
packages = [
{ include = "pwndbg" },
]
[tool.poetry.dependencies]
python = "^3.8"
capstone = "5.0.0.post1"
ipython = "8.12.3"
# Needed by Capstone due to https://github.com/pwndbg/pwndbg/pull/1946#issuecomment-1921603947
setuptools = "69.0.3"
psutil = "5.9.5"
pwntools = "4.11.0"
pycparser = "2.21"
pyelftools = "0.29"
pygments = "2.15.0"
ropgadget = "7.2"
sortedcontainers = "2.4.0"
tabulate = "0.9.0"
typing-extensions = "4.6.1"
unicorn = "2.0.1.post1"
requests = "2.31.0"
pt = {git = "https://github.com/martinradev/gdb-pt-dump", rev = "89ea252f6efc5d75eacca16fc17ff8966a389690"}
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
black = "24.2.0"
coverage = {version = "7.4.3", extras = ["toml"]}
isort = "5.13.2"
mypy = "1.8.0"
pytest = "8.0.2"
pytest-cov = "4.1.0"
rich = "13.7.1"
ruff = "0.3.0"
testresources = "2.0.1"
tomli = "2.0.1"
types-gdb = "12.1.4.20240305"
types-psutil = "5.9.5.20240205"
types-pygments = "2.17.0.20240106"
types-requests = "2.31.0.20240218"
types-tabulate = "0.9.0.20240106"
vermin = "1.6.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"