Skip to content

Commit

Permalink
main failures: add --reverse and --bullet to customize output
Browse files Browse the repository at this point in the history
  • Loading branch information
gotmax23 committed Dec 3, 2023
1 parent 14a776b commit 9352199
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ def get_error_tuples(


@app.command()
def failures(
ctx: typer.Context,
) -> None:
def failures(ctx: typer.Context, bullet: str = "*", reverse: bool = False) -> None:
sargs = ctx.ensure_object(Args)
sanity = sargs.data["collections"]
upstreams = sargs.upstreams_data["collections"]
Expand All @@ -218,9 +216,9 @@ def failures(
if (out := dict(get_error_tuples(sanity_out, upstreams.get(collection))))
}
for collection, test_data in sorted(
failed_collectiions.items(), key=lambda x: sum(x[1].values())
failed_collectiions.items(), key=(lambda x: sum(x[1].values())), reverse=reverse
):
print("*", collection)
print(bullet, collection)
for name, output_count in sorted(
test_data.items(), key=lambda x: x[1], reverse=True
):
Expand Down

0 comments on commit 9352199

Please sign in to comment.