Skip to content
Snippets Groups Projects

Resolve "front-matter linter"

Merged Remi PLANEL requested to merge front-matter-linter into main
1 file
+ 6
2
Compare changes
  • Side-by-side
  • Inline
@@ -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")