Skip to content

feat: added test and workflow that verifies templates#32

Merged
RafaelJohn9 merged 5 commits intomainfrom
update/template-first-line-convention
Jun 30, 2025
Merged

feat: added test and workflow that verifies templates#32
RafaelJohn9 merged 5 commits intomainfrom
update/template-first-line-convention

Conversation

@RafaelJohn9
Copy link
Copy Markdown
Member

@RafaelJohn9 RafaelJohn9 commented Jun 30, 2025

fix #26

feat: added test and workflow that verifies all templates start with a comment in the first line.

…a comment in the first line

Signed-off-by: rafaeljohn9 <rafaeljohb@gmail.com>
…capture all files instead of failing the first time it finds an invalid template\n

Signed-off-by: rafaeljohn9 <rafaeljohb@gmail.com>
Signed-off-by: rafaeljohn9 <rafaeljohb@gmail.com>
…issing

Signed-off-by: rafaeljohn9 <rafaeljohb@gmail.com>
@RafaelJohn9 RafaelJohn9 requested a review from Copilot June 30, 2025 08:48
Copy link
Copy Markdown
Contributor

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

Adds a Rust test and a GitHub Actions workflow to ensure every file under templates/ begins with the correct comment syntax, and updates all existing templates accordingly.

  • Introduces tests/verify_templates.rs to recursively check first-line comments based on file extension.
  • Prepends appropriate comment lines to various markdown and YAML template files.
  • Adds .github/workflows/verify-templates.yml to run the new test on pull requests.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/verify_templates.rs New test that validates first-line comments in templates
templates/pr-templates/*.md Added HTML-comment prefixes (<!-- ... -->)
templates/issue-templates/bug.yml Removed leading dash to allow first-line # comment
templates/CODE_OF_CONDUCT.md Added HTML-comment prefix
.github/workflows/verify-templates.yml New workflow to run the verify-templates test
Comments suppressed due to low confidence (1)

tests/verify_templates.rs:76

  • Change the expected prefix output from {:?} to {} in the println! so the prefix is printed without extra quotes, making it easier to read.
            println!(

Comment thread tests/verify_templates.rs Outdated
Comment thread tests/verify_templates.rs
Better way to create hashmap

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@RafaelJohn9 RafaelJohn9 merged commit f93feb9 into main Jun 30, 2025
2 checks passed
@RafaelJohn9 RafaelJohn9 deleted the update/template-first-line-convention branch June 30, 2025 08:56
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.

[Test]: All templates stored in the repo should have their first line as a comment.

2 participants