Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "show ignored findings by default for checklist" #1643

Merged
merged 3 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions slither/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ def process_single(
ast = "--ast-compact-json"
if args.legacy_ast:
ast = "--ast-json"
if args.checklist:
args.show_ignored_findings = True

slither = Slither(target, ast_format=ast, **vars(args))

return _process(slither, detector_classes, printer_classes)
Expand Down Expand Up @@ -871,7 +868,9 @@ def main_impl(

# Output our results to markdown if we wish to compile a checklist.
if args.checklist:
output_results_to_markdown(results_detectors, args.checklist_limit)
output_results_to_markdown(
results_detectors, args.checklist_limit, args.show_ignored_findings
)

# Don't print the number of result for printers
if number_contracts == 0:
Expand Down
9 changes: 8 additions & 1 deletion slither/utils/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def convert_result_to_markdown(txt: str) -> str:
return "".join(ret)


def output_results_to_markdown(all_results: List[Dict], checklistlimit: str) -> None:
def output_results_to_markdown(
all_results: List[Dict], checklistlimit: str, show_ignored_findings: bool
) -> None:
checks = defaultdict(list)
info: Dict = defaultdict(dict)
for results_ in all_results:
Expand All @@ -179,6 +181,11 @@ def output_results_to_markdown(all_results: List[Dict], checklistlimit: str) ->
"confidence": results_["confidence"],
}

if not show_ignored_findings:
print(
"**THIS CHECKLIST IS NOT COMPLETE**. Use `--show-ignored-findings` to show all the results."
)

print("Summary")
for check_ in checks:
print(
Expand Down