Skip to content

Commit

Permalink
generate unique IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
jwdevantier committed Feb 22, 2024
1 parent ea3c526 commit 18025ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/spex/jsonspec/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(self, args: ParserArgs, doc: "ElementTree", spec: str, revision: st
self.__linter = DocLinter()
self.__post_init__()
self._unwind_parse_error = False
self.__fig_id_missing_counter = 0

def __post_init__(self) -> None:
...
Expand Down Expand Up @@ -147,9 +148,12 @@ def _on_extract_figure_id(self, figure_title: str) -> str:
ULog.ERROR,
f"failed extracting title from figure header {figure_title!r}",
)
fig_id = self.__fig_id_missing_counter
self.__fig_id_missing_counter = fig_id + 1

self.linter.add_issue(
LintErr.TBL_FIG_ID_EXTRACT_ERR,
"FIG_ID_MISSING",
f"FIG_ID_MISSING[{fig_id}]",
ctx={"title": figure_title},
)
raise RuntimeError(f"failed to extract figure ID from {figure_title!r}")
Expand Down

0 comments on commit 18025ad

Please sign in to comment.