Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
15819706
Commit
15819706
authored
Mar 30, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctb: Add triage mode to slither script
Also ensures that absolute local paths are not stored in the slither db.
parent
e56dc24a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
package.json
packages/contracts-bedrock/package.json
+1
-0
slither.sh
packages/contracts-bedrock/scripts/slither.sh
+19
-6
No files found.
packages/contracts-bedrock/package.json
View file @
15819706
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
"storage-snapshot"
:
"./scripts/storage-snapshot.sh"
,
"storage-snapshot"
:
"./scripts/storage-snapshot.sh"
,
"validate-spacers"
:
"hardhat compile && hardhat validate-spacers"
,
"validate-spacers"
:
"hardhat compile && hardhat validate-spacers"
,
"slither"
:
"./scripts/slither.sh"
,
"slither"
:
"./scripts/slither.sh"
,
"slither:triage"
:
"TRIAGE_MODE=1 ./scripts/slither.sh"
,
"clean"
:
"rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo ./src/contract-artifacts.ts ./test-case-generator/fuzz"
,
"clean"
:
"rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo ./src/contract-artifacts.ts ./test-case-generator/fuzz"
,
"lint:ts:check"
:
"eslint . --max-warnings=0"
,
"lint:ts:check"
:
"eslint . --max-warnings=0"
,
"lint:forge-tests:check"
:
"ts-node scripts/forge-test-names.ts"
,
"lint:forge-tests:check"
:
"ts-node scripts/forge-test-names.ts"
,
...
...
packages/contracts-bedrock/scripts/slither.sh
View file @
15819706
...
@@ -2,11 +2,24 @@
...
@@ -2,11 +2,24 @@
rm
-rf
artifacts forge-artifacts
rm
-rf
artifacts forge-artifacts
# Handle slither bug unable to work with the foundry tests
TEMP
=
$(
mktemp
-d
)
mv
contracts/test
$TEMP
/test
# See slither.config.json for slither settings
# See slither.config.json for slither settings
slither
.
if
[
-n
"
$TRIAGE_MODE
"
]
;
then
# Slither's triage mode will run an 'interview' in the terminal, allowing you to review each of
# its findings, and specify which should be ignored in future runs of slither. This will update
# (or create) the slither.db.json file. This DB is a cleaner alternative to adding slither-disable
# comments throughout the codebase.
# Triage mode should only be run manually, and can be used to update the db when new findings are
# causing a CI failure.
slither
.
--triage-mode
mv
$TEMP
/test contracts/test
# For whatever reason the slither db contains a filename_absolute property which includes the full
# local path to source code on the machine where it was generated. This property does not
# seem to be required for slither to run, so we remove it.
DB
=
slither.db.json
TEMP_DB
=
temp-slither.db.json
mv
$DB
$TEMP_DB
jq
'walk(if type == "object" then del(.filename_absolute) else . end)'
$TEMP_DB
>
$DB
rm
-f
$TEMP_DB
else
slither
.
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment