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

Use explicit encoding in ruleset xml files #4586

Merged
merged 2 commits into from
Oct 19, 2023
Merged

Conversation

adangel
Copy link
Member

@adangel adangel commented Jun 1, 2023

Describe the PR

Just a minor tweak I noticed recently. It's better to explicitly state the encoding, that is used. This avoids confusion.

This change also adds tests to ensure, that the encoding for the category ruleset files is UTF-8.

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@adangel adangel added the in:ruleset-xml About the ruleset schema/parser label Jun 1, 2023
@adangel adangel added this to the 7.0.0 milestone Jun 1, 2023
@ghost
Copy link

ghost commented Jun 1, 2023

1 Message
📖 Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@@ -230,6 +231,36 @@ void testXmlSchema() throws Exception {
assertTrue(allValid, "All XML must parse without producing validation messages.");
}

@Test
void verifyCorrectXmlEncoding() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

rather than a test, this seems like something we can create a PMD rule for and have it enabled in our dogfooding.

Copy link
Member

Choose a reason for hiding this comment

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

I've just realized that the XML declaration data in unobtainable from our AST, so this rule could not be implemented… so I extended our XML language and created the rule in #4592 :)

@jsotuyod jsotuyod mentioned this pull request Jun 6, 2023
4 tasks
adangel added a commit to adangel/pmd that referenced this pull request Oct 19, 2023
adangel added a commit that referenced this pull request Oct 19, 2023
Use explicit encoding in ruleset xml files #4586
@adangel adangel merged commit 451a364 into pmd:master Oct 19, 2023
@adangel adangel deleted the ruleset-xml branch October 19, 2023 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:ruleset-xml About the ruleset schema/parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants