|
| 1 | +from pathlib import Path |
1 | 2 | from typing import Optional |
2 | 3 |
|
3 | 4 | import click |
4 | 5 | from uuid6 import UUID |
5 | 6 |
|
6 | 7 | from typeid import TypeID, base32, from_uuid, get_prefix_and_suffix |
7 | | - |
8 | | -from typeid.explain.engine import explain as explain_engine |
9 | 8 | from typeid.explain.discovery import discover_schema_path |
| 9 | +from typeid.explain.engine import explain as explain_engine |
10 | 10 | from typeid.explain.formatters import format_explanation_json, format_explanation_pretty |
11 | 11 | from typeid.explain.registry import load_registry, make_lookup |
12 | 12 |
|
@@ -49,7 +49,7 @@ def decode(encoded: str) -> None: |
49 | 49 | type=click.Path(exists=True, dir_okay=False, path_type=str), |
50 | 50 | required=False, |
51 | 51 | help="Path to TypeID schema file (JSON, or YAML if PyYAML is installed). " |
52 | | - "If omitted, TypeID will try to discover a schema automatically.", |
| 52 | + "If omitted, TypeID will try to discover a schema automatically.", |
53 | 53 | ) |
54 | 54 | @click.option( |
55 | 55 | "--json", |
@@ -98,10 +98,6 @@ def explain( |
98 | 98 | # we keep CLI robust and simply proceed without schema. |
99 | 99 |
|
100 | 100 | if resolved_path: |
101 | | - result = load_registry(click.Path(resolved_path)) |
102 | | - # NOTE: click.Path is not a real filesystem path. Convert to pathlib Path. |
103 | | - # We'll do it safely: |
104 | | - from pathlib import Path |
105 | 101 | result = load_registry(Path(resolved_path)) |
106 | 102 |
|
107 | 103 | if result.registry is not None: |
|
0 commit comments