Fix some formatting issues

This commit is contained in:
ItsDrike 2023-02-02 22:08:41 +01:00
parent c9d593ef4f
commit 8767fdf367
No known key found for this signature in database
GPG key ID: B014E761034AF742

View file

@ -12,7 +12,6 @@ from enum import Enum, auto
from pathlib import Path from pathlib import Path
from typing import NamedTuple, Optional from typing import NamedTuple, Optional
try: try:
import rich import rich
except ImportError: except ImportError:
@ -186,6 +185,7 @@ def print_report(diffs: Iterable[FileDiff]) -> None:
return return
from rich.table import Table from rich.table import Table
table = Table() table = Table()
table.add_column("Status") table.add_column("Status")
table.add_column("System file", style="magenta") table.add_column("System file", style="magenta")
@ -195,7 +195,7 @@ def print_report(diffs: Iterable[FileDiff]) -> None:
_str_status = diff.status.name.replace("_", " ") _str_status = diff.status.name.replace("_", " ")
match diff.status: match diff.status:
case DiffStatus.MATCH: case DiffStatus.MATCH:
status_str = (f"[green]{_str_status}[/green]") status_str = f"[green]{_str_status}[/green]"
case DiffStatus.PERMISSION_ERROR: case DiffStatus.PERMISSION_ERROR:
status_str = f"[bold yellow]{_str_status}[/bold yellow]" status_str = f"[bold yellow]{_str_status}[/bold yellow]"
case DiffStatus.NOT_FOUND: case DiffStatus.NOT_FOUND:
@ -306,7 +306,6 @@ def apply_fix(diff: FileDiff) -> None:
return return
def show_diffs(diffs: Iterable[FileDiff], ask_show_diff: bool, apply_fix_prompt: bool) -> None: def show_diffs(diffs: Iterable[FileDiff], ask_show_diff: bool, apply_fix_prompt: bool) -> None:
for diff in diffs: for diff in diffs:
match diff.status: match diff.status: