mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 14:15:19 -04:00
Docs: Add warning for bad usage strings
This commit is contained in:
parent
fb643211e1
commit
6e8e403088
2 changed files with 19 additions and 0 deletions
|
|
@ -311,6 +311,11 @@ def render_keyword(
|
|||
location = get_text(keyword.find("LOCATION"))
|
||||
lone_keyword_value = get_text(keyword.find("LONE_KEYWORD_VALUE"))
|
||||
|
||||
# Check that the usage string starts with one of the keyword names.
|
||||
if keyword.tag == "KEYWORD" and usage:
|
||||
if not any(usage.upper().startswith(n) for n in keyword_names):
|
||||
print(f"Warning: Keyword {keyword_xref} has bad usage: {location}")
|
||||
|
||||
# Find keyword data type.
|
||||
data_type_element = keyword.find("DATA_TYPE")
|
||||
assert data_type_element is not None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue