Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CCPP metadata file standard name checking script #47

Merged
merged 12 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
sudo apt-get -y install libxml2-utils

- name: Check for duplicate standard names
run: python3 check_xml_unique.py standard_names.xml
run: tools/check_xml_unique.py standard_names.xml

check-rerendered-markdown:
runs-on: ubuntu-latest
Expand All @@ -41,5 +41,5 @@ jobs:
# If this fails you have likely forgotten to rerun the write script
# after adding a new name, or updating its description.
checksum=$(sha256sum Metadata-standard-names.md)
python3 write_standard_name_table.py standard_names.xml
tools/write_standard_name_table.py standard_names.xml
test "$checksum" = "$(sha256sum Metadata-standard-names.md)"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A Markdown file describing the standard names

To regenerate the standard name Markdown file, run:
```
python write_standard_name_table.py standard_names.xml
tools/write_standard_name_table.py standard_names.xml
```

Then, commit the new Metadata-standard-names.md file and push to GitHub.
17 changes: 15 additions & 2 deletions check_xml_unique.py → tools/check_xml_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,21 @@
import sys
import os.path
import xml.etree.ElementTree as ET
from xml_tools import find_schema_file, find_schema_version, validate_xml_file, read_xml_file
import copy

################################################
#Add CCPP framework (lib) modules to python path
################################################

_CURR_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(_CURR_DIR, "lib"))

#######################################
#Import needed framework python modules
#######################################

from xml_tools import find_schema_file, find_schema_version, validate_xml_file, read_xml_file

###############################################################################
def parse_command_line(args, description):
###############################################################################
Expand Down Expand Up @@ -40,7 +52,8 @@ def main_func():
version = find_schema_version(root)
schema_name = os.path.basename(stdname_file)[0:-4]
schema_root = os.path.dirname(stdname_file)
schema_file = find_schema_file(schema_name, version)
schema_path = os.path.join(schema_root,schema_name)
schema_file = find_schema_file(schema_path, version)
if schema_file:
try:
validate_xml_file(stdname_file, schema_name, version, None,
Expand Down
File renamed without changes.
Loading