Skip to content
Snippets Groups Projects
Commit 16641eb3 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

add rule for each system

parent ff5619de
No related branches found
No related tags found
2 merge requests!122Front matter linter,!93Resolve "front-matter linter"
Pipeline #116661 passed with warnings
......@@ -7,7 +7,10 @@ from pydantic_yaml import parse_yaml_raw_as, to_yaml_str
import frontmatter
from enum import Enum
from rich.console import Console
from rich.pretty import pprint
from rich import print as rprint
from rich.layout import Layout
from rich.panel import Panel
console = Console()
app = typer.Typer()
......@@ -53,7 +56,8 @@ def lint(
),
],
):
print(f"check system {file}")
console.rule(f"[bold blue]{file.name}", style="blue")
with open(file) as f:
metadata, _ = frontmatter.parse(f.read())
# print(metadata)
......@@ -65,7 +69,8 @@ def lint(
# print(exc.errors())
# pprint(exc.errors(), expand_all=True)
for err in exc.errors():
console.print(f"{err['msg']} : {err['type']} {','.join(err['loc'])}", style="red")
print("\n")
console.print(
f"[red]{err['msg']} : {err['type']} {' -> '.join(err['loc'])}"
)
else:
console.print("OK!\n", style="green")
console.print("[green] Everything is alright")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment