Skip to content

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Dec 2, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a template checker to CI that validates Amendment category XLS documents against the AMENDMENT_TEMPLATE.md structure. The changes include new validation scripts, site generation infrastructure with HTML templates and CSS assets, and updated CI workflows to run the new validation checks.

Key changes:

  • Introduces validate_amendment_template.py script to check Amendment specs for required sections and placeholder text
  • Adds xls_parser.py to extract and validate metadata from XLS documents
  • Sets up static site generation infrastructure with HTML templates, CSS assets, and build scripts

Reviewed changes

Copilot reviewed 3 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
scripts/validate_amendment_template.py New validation script that checks Amendment specs for template compliance, including section structure and placeholder detection
scripts/xls_parser.py New parser script that extracts and validates XLS document metadata from markdown files
.github/workflows/validate-xls.yml Updated paths from site/ to scripts/ and added new job to run amendment template validation
.github/workflows/deploy.yml Updated paths from site/ to scripts/ for consistent directory structure
scripts/templates/index.html New template for the main index page with sortable standards table and category navigation
scripts/templates/category.html New template for category-filtered pages with sortable table
scripts/templates/contribute.html New template for the contribution guidelines page
scripts/templates/xls.html Whitespace-only formatting fix
scripts/templates/base.html Whitespace-only formatting fix
scripts/assets/style.css New CSS file with XRPL.org themed styling for the site
scripts/assets/favicon.ico New favicon asset for the site
scripts/build_site.py Whitespace-only formatting fixes
scripts/requirements.txt Whitespace-only formatting fixes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +311 to +314
if re.search(pattern, line):
self.errors.append(ValidationError(
str(self.file_path), line_num,
f"Found template placeholder text: {pattern}"
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message shows the raw regex pattern, which will be confusing to users. For example, a pattern like r'\[STypeName\]' would be displayed literally in the error. Consider extracting the actual matched text from the line and showing that instead, or providing a more user-friendly description of what placeholder was found.

Suggested change
if re.search(pattern, line):
self.errors.append(ValidationError(
str(self.file_path), line_num,
f"Found template placeholder text: {pattern}"
match = re.search(pattern, line)
if match:
placeholder_text = match.group(0)
self.errors.append(ValidationError(
str(self.file_path), line_num,
f"Found template placeholder text: {placeholder_text}"

Copilot uses AI. Check for mistakes.
Comment on lines +264 to +269
# Get all direct subsections (level 3) for this parent
parent_num = parent_section.number
subsections = [
s for s in self.sections
if s.number.startswith(parent_num + ".") and s.level == 3
]
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subsection filtering logic may not work correctly for subsections with deeper nesting. The condition s.number.startswith(parent_num + ".") will match both direct children (e.g., "1.1") and deeper descendants (e.g., "1.1.1", "1.1.2"). While the s.level == 3 check helps filter for direct children, if a spec has subsections at level 4 or deeper that start with the parent number, this could still cause issues. Consider using a more precise check that ensures only direct children are included.

Copilot uses AI. Check for mistakes.
Comment on lines +362 to +364
changed_files = result.stdout.strip().split('\n')

# Filter for XLS README.md files
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the git diff returns an empty stdout, calling split('\n') will create a list with one empty string element ['']. This will cause line 367 to evaluate an empty string which will incorrectly pass the startswith('XLS-') check. Consider handling empty output explicitly or filtering out empty strings.

Suggested change
changed_files = result.stdout.strip().split('\n')
# Filter for XLS README.md files
raw_changed_files = result.stdout.strip().split('\n') if result.stdout else []
# Filter out empty strings and then filter for XLS README.md files
changed_files = [f for f in raw_changed_files if f]

Copilot uses AI. Check for mistakes.
if '<pre>' in line:
in_metadata = True
elif '</pre>' in line and in_metadata:
in_metadata = False
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable in_metadata is not used.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant