-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathpyproject.toml
More file actions
185 lines (176 loc) · 6.2 KB
/
pyproject.toml
File metadata and controls
185 lines (176 loc) · 6.2 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
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "slither-analyzer"
version = "0.11.5"
description = "Slither is a Solidity and Vyper static analysis framework written in Python 3."
readme = "README.md"
requires-python = ">=3.10"
license = {text = "AGPL-3.0"}
authors = [
{name = "Trail of Bits"},
]
maintainers = [
{name = "Trail of Bits"},
]
urls = {Homepage = "https://github.com/crytic/slither"}
keywords = ["solidity", "vyper", "static-analysis", "security", "ethereum", "smart-contracts"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"packaging",
"prettytable>=3.10.2",
"pycryptodome>=3.4.6",
"crytic-compile>=0.3.9,<0.4.0",
"web3>=7.10,<8",
"eth-abi>=5.0.1",
"eth-typing>=5.0.0",
"eth-utils>=5.0.0",
]
[project.optional-dependencies]
simil = ["fasttext>=0.9.0"]
# Development dependencies using PEP 735 dependency-groups
[dependency-groups]
lint = [
"ruff==0.14.13",
"yamllint==1.38.0"
]
test = [
"pytest",
"pytest-cov",
"pytest-xdist",
"deepdiff",
"numpy",
"coverage[toml]",
"filelock",
"pytest-insta",
]
doc = [
"pdoc",
]
dev = [
{include-group = "lint"},
{include-group = "test"},
{include-group = "doc"},
"openai",
]
[project.scripts]
slither = "slither.__main__:main"
slither-check-upgradeability = "slither.tools.upgradeability.__main__:main"
slither-find-paths = "slither.tools.possible_paths.__main__:main"
slither-simil = "slither.tools.similarity.__main__:main"
slither-flat = "slither.tools.flattening.__main__:main"
slither-format = "slither.tools.slither_format.__main__:main"
slither-check-erc = "slither.tools.erc_conformance.__main__:main"
slither-check-kspec = "slither.tools.kspec_coverage.__main__:main"
slither-prop = "slither.tools.properties.__main__:main"
slither-mutate = "slither.tools.mutator.__main__:main"
slither-read-storage = "slither.tools.read_storage.__main__:main"
slither-doctor = "slither.tools.doctor.__main__:main"
slither-documentation = "slither.tools.documentation.__main__:main"
slither-interface = "slither.tools.interface.__main__:main"
[tool.hatch.build.targets.wheel]
packages = ["slither"]
[tool.ruff]
line-length = 100
# Target Python 3.10+ (current minimum version)
target-version = "py310"
# Additional exclusions beyond defaults and .gitignore
extend-exclude = [
"docs/",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"RUF", # Ruff-specific rules
]
# NOTE: When updating ruff version range, also update .pre-commit-config.yaml
# by running: pre-commit autoupdate
# Ignore rules to match previous black + pylint configuration
ignore = [
# From pylint disabled rules
"E501", # line-too-long (was disabled in pylint)
"F401", # unused-import (similar to import-error tolerance)
"F841", # unused-variable
"ARG001", # unused-function-argument
"ARG002", # unused-method-argument
"ARG003", # unused-class-method-argument
"B008", # function-call-in-default-argument
"B904", # raise-without-from-inside-except
"C408", # unnecessary-collection-call
"SIM102", # collapsible-if (complexity tolerance)
"SIM103", # needless-bool (allow explicit bool returns)
"SIM105", # suppressible-exception
"SIM108", # if-else-block-instead-of-if-exp (complexity tolerance)
"SIM114", # if-with-same-arms
"SIM117", # with-statement (complexity tolerance)
"TC001", # typing-only-first-party-import
"TC002", # typing-only-third-party-import
"TC003", # typing-only-standard-library-import
"RUF001", # ambiguous-unicode-character-string
"RUF002", # ambiguous-unicode-character-docstring
"RUF003", # ambiguous-unicode-character-comment
# Additional rules for compatibility
"B006", # mutable-argument-default
"B007", # unused-loop-control-variable
"B018", # useless-expression
"C401", # unnecessary-generator-set
"C403", # unnecessary-list-comprehension-set
"SIM110", # reimplemented-builtin
"SIM112", # uncapitalized-environment-variables
# Disable additional rules to avoid code changes
"I001", # unsorted-imports (453 issues)
"RUF005", # collection-literal-concatenation (57 issues)
"RUF015", # unnecessary-iterable-allocation-for-first-element (15 issues)
"E741", # ambiguous-variable-name (14 issues)
"RUF012", # mutable-class-default (12 issues)
"E731", # lambda-assignment (11 issues)
"F821", # undefined-name (3 issues - might be false positives)
"B011", # assert-false (1 issue)
"B020", # loop-variable-overrides-iterator (1 issue)
"B026", # star-arg-unpacking-after-keyword-arg (1 issue)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
# Allow common variable names that pylint was configured to accept
allowed-confusables = ["'", "'", "–", "—"]
[tool.ruff.lint.per-file-ignores]
# Test files can have more relaxed rules
"tests/**/*.py" = [
"ARG", # Unused arguments are OK in tests
"S101", # assert is OK in tests
"SIM", # Simplification rules can be relaxed in tests
]
# RTLO detector has intentional mixed indentation in exploit scenario
"slither/detectors/source/rtlo.py" = ["E101"]
# Scripts can have different rules
"scripts/**/*.py" = [
"T201", # print is OK in scripts
]
[tool.ruff.lint.isort]
# Match the project's import style
force-single-line = false
force-sort-within-sections = false
lines-after-imports = 2
known-first-party = ["slither"]
known-third-party = ["crytic_compile"]