Merge pull request #1359 from crytic/boyan/no-fail-pedantic

Add the `--no-fail-pedantic` flag
pull/1360/head
Feist Josselin 2 years ago committed by GitHub
commit 719e4e98d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      scripts/ci_test_cli.sh
  2. 4
      scripts/ci_test_truffle.sh
  3. 10
      slither/__main__.py
  4. 2
      slither/utils/command_line.py

@ -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

@ -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

@ -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",

@ -34,7 +34,7 @@ defaults_flag_in_config = {
"exclude_low": False,
"exclude_medium": False,
"exclude_high": False,
"fail_pedantic": False,
"fail_pedantic": True,
"fail_low": False,
"fail_medium": False,
"fail_high": False,

Loading…
Cancel
Save