mirror of
https://git.dn42.dev/dn42/registry.git
synced 2025-07-18 16:37:01 +08:00
add schema bootstrap
This commit is contained in:
parent
73706cfdce
commit
8efd1feb80
9 changed files with 28 additions and 3 deletions
|
@ -148,8 +148,8 @@ class FileDOM:
|
|||
@property
|
||||
def schema(self) -> str:
|
||||
"""return the schema name for file"""
|
||||
if len(self.dom) < 0:
|
||||
return "none"
|
||||
if len(self.dom) < 1:
|
||||
return None
|
||||
|
||||
return self.dom[0].key
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ def run(path: str = "."):
|
|||
s = schemas.get(dom.rel)
|
||||
if s is None:
|
||||
print(f"{dom.src} schema not found for {dom.rel}")
|
||||
continue
|
||||
|
||||
status = s.check_file(dom, lookups)
|
||||
status.print()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue