Skip to content

Commit

Permalink
Merge pull request #1359 from crytic/boyan/no-fail-pedantic
Browse files Browse the repository at this point in the history
Add the `--no-fail-pedantic` flag
  • Loading branch information
montyly authored Aug 24, 2022
2 parents 78397b9 + 082dd94 commit 719e4e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scripts/ci_test_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

solc-select use 0.7.0

if ! slither "tests/config/test.sol" --solc-ast; then
if ! slither "tests/config/test.sol" --solc-ast --no-fail-pedantic; then
echo "--solc-ast failed"
exit 1
fi

if ! slither "tests/config/test.sol" --solc-disable-warnings; then
if ! slither "tests/config/test.sol" --solc-disable-warnings --no-fail-pedantic; then
echo "--solc-disable-warnings failed"
exit 1
fi

if ! slither "tests/config/test.sol" --disable-color; then
if ! slither "tests/config/test.sol" --disable-color --no-fail-pedantic; then
echo "--disable-color failed"
exit 1
fi
4 changes: 2 additions & 2 deletions scripts/ci_test_truffle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ nvm use --lts
npm install -g truffle
truffle unbox metacoin

if ! slither .; then
if ! slither . --no-fail-pedantic; then
echo "Truffle test failed"
exit 1
fi

exit 0
exit 0
10 changes: 9 additions & 1 deletion slither/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,19 @@ def parse_args(detector_classes, printer_classes): # pylint: disable=too-many-s

group_detector.add_argument(
"--fail-pedantic",
help="Fail if any finding is detected",
help="Return the number of findings in the exit code",
action="store_true",
default=defaults_flag_in_config["fail_pedantic"],
)

group_detector.add_argument(
"--no-fail-pedantic",
help="Do not return the number of findings in the exit code. Opposite of --fail-pedantic",
dest="fail_pedantic",
action="store_false",
required=False,
)

group_detector.add_argument(
"--fail-low",
help="Fail if low or greater impact finding is detected",
Expand Down
2 changes: 1 addition & 1 deletion slither/utils/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"exclude_low": False,
"exclude_medium": False,
"exclude_high": False,
"fail_pedantic": False,
"fail_pedantic": True,
"fail_low": False,
"fail_medium": False,
"fail_high": False,
Expand Down

0 comments on commit 719e4e9

Please sign in to comment.