forked from phoedos/pmd
Merge pull request #4586 from adangel:ruleset-xml
Use explicit encoding in ruleset xml files #4586
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="All Regression Rules"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -51,6 +51,7 @@ The remaining section describes the complete release notes for 7.0.0.
|
||||
|
||||
* miscellaneous
|
||||
* [#4699](https://github.com/pmd/pmd/pull/4699): Make PMD buildable with java 21
|
||||
* [#4586](https://github.com/pmd/pmd/pull/4586): Use explicit encoding in ruleset xml files
|
||||
* java-codestyle
|
||||
* [#2847](https://github.com/pmd/pmd/issues/2847): \[java] New Rule: Use Explicit Types
|
||||
* [#4578](https://github.com/pmd/pmd/issues/4578): \[java] CommentDefaultAccessModifier comment needs to be before annotation if present
|
||||
@ -396,6 +397,7 @@ See also [Detailed Release Notes for PMD 7]({{ baseurl }}pmd_release_notes_pmd7.
|
||||
* [#4462](https://github.com/pmd/pmd/issues/4462): Provide Software Bill of Materials (SBOM)
|
||||
* [#4460](https://github.com/pmd/pmd/pull/4460): Fix assembly-plugin warnings
|
||||
* [#4582](https://github.com/pmd/pmd/issues/4582): \[dist] Download link broken
|
||||
* [#4586](https://github.com/pmd/pmd/pull/4586): Use explicit encoding in ruleset xml files
|
||||
* [#4691](https://github.com/pmd/pmd/issues/4691): \[CVEs] Critical and High CEVs reported on PMD and PMD dependencies
|
||||
* [#4699](https://github.com/pmd/pmd/pull/4699): Make PMD buildable with java 21
|
||||
* ant
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Best Practices"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Code Style"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Design"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Documentation"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Error Prone"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Multithreading"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Performance"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="Security"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -9,12 +9,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.AbstractRuleSetFactoryTest;
|
||||
import net.sourceforge.pmd.RuleSet;
|
||||
import net.sourceforge.pmd.RuleSetLoader;
|
||||
|
||||
import com.github.stefanbirkner.systemlambda.SystemLambda;
|
||||
|
||||
class DefaultRulesetTest {
|
||||
private static final String QUICKSTART_RULESET = "rulesets/apex/quickstart.xml";
|
||||
|
||||
@Test
|
||||
void loadDefaultRuleset() {
|
||||
@ -25,12 +27,17 @@ class DefaultRulesetTest {
|
||||
@Test
|
||||
void loadQuickstartRuleset() throws Exception {
|
||||
String log = SystemLambda.tapSystemErr(() -> {
|
||||
RuleSet ruleset = rulesetLoader().loadFromResource("rulesets/apex/quickstart.xml");
|
||||
RuleSet ruleset = rulesetLoader().loadFromResource(QUICKSTART_RULESET);
|
||||
assertNotNull(ruleset);
|
||||
});
|
||||
assertTrue(log.isEmpty(), "No Logging expected");
|
||||
}
|
||||
|
||||
@Test
|
||||
void correctEncoding() throws Exception {
|
||||
assertTrue(AbstractRuleSetFactoryTest.hasCorrectEncoding(QUICKSTART_RULESET));
|
||||
}
|
||||
|
||||
private RuleSetLoader rulesetLoader() {
|
||||
return new RuleSetLoader().enableCompatibility(false);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="All ECMAScript Rules"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="All Java Rules"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="33"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="34"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="35"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="36"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="37"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="37"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="38"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="39"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="40rc1"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="41"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="42"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="50"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="501"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="510"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="512"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="520"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ruleset name="540"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user