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

add color

parent c43a7019
No related branches found
No related tags found
2 merge requests!122Front matter linter,!93Resolve "front-matter linter"
Pipeline #116642 passed with warnings
......@@ -6,7 +6,10 @@ from pydantic import BaseModel, ValidationError
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
console = Console()
app = typer.Typer()
......@@ -60,8 +63,9 @@ def lint(
# print(repr(exc.errors()[0]["type"]))
# print(repr(exc))
# print(exc.errors())
# pprint(exc.errors(), expand_all=True)
for err in exc.errors():
print(f"{err['msg']} : {err['type']} {err['loc']}")
console.print(f"{err['msg']} : {err['type']} {','.join(err['loc'])}", style="red")
print("\n")
else:
print("OK!\n")
console.print("OK!\n", style="green")
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