Skip to content

Commit 4892be0

Browse files
committed
toolchain: accept registry value names and intrinsics in doc lint
1 parent 576154b commit 4892be0

1 file changed

Lines changed: 11 additions & 23 deletions

File tree

toolchain/mfc/lint_docs.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,8 @@
6767
# Hardcoded Fortran constants (not case-file params)
6868
"init_dir",
6969
"zeros_default",
70-
# Enumerated value names used as prose examples (not parameter names)
71-
"hll",
72-
"hllc",
73-
# Analytic expression language: Fortran intrinsics and module name (not case params)
70+
# Analytic expression language: module name (not a case param)
7471
"m_constants",
75-
"sin",
76-
"cos",
77-
"tan",
78-
"asin",
79-
"acos",
80-
"atan",
81-
"atan2",
82-
"sinh",
83-
"cosh",
84-
"tanh",
85-
"exp",
86-
"log",
87-
"log10",
88-
"sqrt",
89-
"abs",
90-
"min",
91-
"max",
92-
"mod",
93-
"sign",
9472
}
9573

9674
# Docs to check for parameter references, with per-file skip sets
@@ -196,11 +174,19 @@ def check_param_refs(repo_root: Path) -> list[str]:
196174
if toolchain_dir not in sys.path:
197175
sys.path.insert(0, toolchain_dir)
198176
try:
177+
from mfc.analytic_expr import INTRINSICS, PASSTHROUGH
199178
from mfc.params import REGISTRY
179+
from mfc.params.definitions import CONSTRAINTS
200180
except ImportError:
201181
print(" Warning: could not import REGISTRY, skipping parameter check")
202182
return []
203183

184+
# Collect all enumerated value names from CONSTRAINTS (e.g. "hll", "hllc", "rk3")
185+
_constraint_names: set[str] = set()
186+
for _entry in CONSTRAINTS.values():
187+
if isinstance(_entry, dict) and "names" in _entry:
188+
_constraint_names.update(_entry["names"].keys())
189+
204190
valid_params = set(REGISTRY.all_params.keys())
205191
# Build set of sub-parameter base names (strip trailing (N) indexes)
206192
_sub_raw = {p.split("%")[-1] for p in valid_params if "%" in p}
@@ -234,6 +220,8 @@ def check_param_refs(repo_root: Path) -> list[str]:
234220
continue
235221
if param in extra_skip:
236222
continue
223+
if param in _constraint_names or param in INTRINSICS or param in PASSTHROUGH:
224+
continue
237225
if "(" in param or ")" in param:
238226
continue
239227
if "[" in param:

0 commit comments

Comments
 (0)