Skip to content

Commit

Permalink
Merge pull request #12 from SigmaHQ/check_output_formatting
Browse files Browse the repository at this point in the history
Some minor formatting changes
  • Loading branch information
thomaspatzke committed Jan 20, 2023
2 parents 3a1e155 + 0f90749 commit 5b0f369
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sigma/cli/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,34 +92,35 @@ def check(input, validation_config, file_pattern, fail_on_error, fail_on_issues)
click.echo(f"Found {rule_error_count} errors, { cond_error_count } condition errors and { issue_count } issues.")

if rule_error_count > 0:
click.echo("\nRule error summary:")
rule_error_table = PrettyTable(
field_names=("Count", "Rule Error"),
align="l",
)
rule_error_table.add_rows([
(error, count)
(count, error)
for error, count in sorted(rule_errors.items(), key=lambda item: item[1], reverse=True)
])
click.echo(rule_error_table.get_string())
else:
click.echo("No rule errors found.")

if cond_error_count > 0:
click.echo("Condition error summary:")
click.echo("\nCondition error summary:")
cond_error_table = PrettyTable(
field_names=("Count", "Condition Error"),
align="l",
)
cond_error_table.add_rows([
(error, count)
(count, error)
for error, count in sorted(cond_errors.items(), key=lambda item: item[1], reverse=True)
])
click.echo(cond_error_table.get_string())
else:
click.echo("No condition errors found.")

if issue_count > 0:
click.echo("Validation issue summary:")
click.echo("\nValidation issue summary:")
validation_issue_summary = PrettyTable(
field_names=("Count", "Issue", "Severity", "Description"),
align="l",
Expand Down

0 comments on commit 5b0f369

Please sign in to comment.