Skip to content

Commit 4143861

Browse files
committed
Fixed the table headers and empty columns
1 parent 393f315 commit 4143861

File tree

1 file changed

+7
-6
lines changed
  • src/strict_syntax_health

1 file changed

+7
-6
lines changed

src/strict_syntax_health/cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ def _run_subworkflows_lint_bulk(subworkflows: list[dict], nextflow_version: str)
12231223

12241224
def display_results(results: list[dict], type_name: str, show_prints_help: bool = False) -> None:
12251225
"""Display results in a rich table."""
1226-
table = Table(f"sanger-tol {type_name.capitalize()} Strict Syntax Health")
1226+
table = Table(title=f"sanger-tol {type_name.capitalize()} Strict Syntax Health")
12271227
table.add_column(type_name.capitalize(), style="cyan")
12281228
table.add_column("Parse Error", justify="right")
12291229
table.add_column("Errors", justify="right")
@@ -1285,7 +1285,7 @@ def display_meta_stats(meta_stats: dict) -> None:
12851285
mod_fail = meta_stats.get("without_topic_versions", 0)
12861286
mod_pct = mod_pass / mod_total * 100 if mod_total else 0
12871287

1288-
mod_table = Table("sanger-tol Modules — topic + version usage (meta.yml)")
1288+
mod_table = Table(title="sanger-tol Modules — topic + version usage (meta.yml)")
12891289
mod_table.add_column("Module", style="cyan")
12901290
mod_table.add_column("topics:", justify="center")
12911291
mod_table.add_column("versions:", justify="center")
@@ -1305,14 +1305,15 @@ def display_meta_stats(meta_stats: dict) -> None:
13051305
swf_fail = meta_stats.get("subworkflow_with_versions", 0)
13061306
swf_pct = swf_pass / swf_total * 100 if swf_total else 0
13071307

1308-
swf_table = Table("sanger-tol Subworkflows — versions channel (main.nf emit)")
1309-
swf_table.add_column("versions channel") # subworkflow name, coloured by status
1308+
swf_table = Table(title="sanger-tol Subworkflows — versions channel (main.nf emit)")
1309+
swf_table.add_column("Subworkflow", style="cyan")
1310+
swf_table.add_column("versions channel", justify="center")
13101311
# Bad ones (has versions) first, then good ones; within each group alphabetical
13111312
for d in sorted(swf_details, key=lambda x: (not x["has_versions"], x["name"])):
13121313
if d["has_versions"]:
1313-
swf_table.add_row(f"[red]{d['name']}[/red]") # has versions = bad
1314+
swf_table.add_row(f"[red]{d['name']}[/red]", "[red]Yes[/red]") # has versions = bad
13141315
else:
1315-
swf_table.add_row(f"[green]{d['name']}[/green]") # no versions = good
1316+
swf_table.add_row(f"[green]{d['name']}[/green]", "[green]No[/green]") # no versions = good
13161317
console.print(swf_table)
13171318
console.print(
13181319
f"[bold]subworkflows: {swf_pass}/{swf_total} ({swf_pct:.1f}%) passing"

0 commit comments

Comments
 (0)