|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <ruleset name="dogfood7" |
3 | | - xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" |
4 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
5 | | - xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> |
| 3 | + xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" |
| 4 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 5 | + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> |
6 | 6 | <description>Rules to check Powertools for Lambda</description> |
7 | 7 | <!-- |
8 | | - Originally copied from: |
9 | | - https://github.com/pmd/build-tools/blob/main/src/main/resources/net/sourceforge/pmd/pmd-dogfood-config.xml |
| 8 | + Originally copied from: https://github.com/pmd/build-tools/blob/main/src/main/resources/net/sourceforge/pmd/pmd-dogfood-config.xml |
10 | 9 | --> |
11 | | - |
| 10 | + |
12 | 11 | <!-- |
13 | 12 | Note: Eventually, this ruleset should include all rules and exclude those, |
14 | 13 | which we know are explicitly decided as not applicable to PMD itself. |
|
212 | 211 | <!-- |
213 | 212 | <rule ref="category/java/design.xml/LoosePackageCoupling"> |
214 | 213 | <properties> |
215 | | - <property |
216 | | - name="packages"><value>net.sourceforge.pmd.lang,net.sourceforge.pmd.lang.java,net.sourceforge.pmd.lang.jsp,net.sourceforge.pmd.lang.ecmascript,net.sourceforge.pmd.lang.cpp</value></property> |
| 214 | + <property name="packages"><value>net.sourceforge.pmd.lang,net.sourceforge.pmd.lang.java,net.sourceforge.pmd.lang.jsp,net.sourceforge.pmd.lang.ecmascript,net.sourceforge.pmd.lang.cpp</value></property> |
217 | 215 | <property name="classes"> |
218 | | - <value>net.sourceforge.pmd.lang.Language,net.sourceforge.pmd.lang.LanguageVersion,net.sourceforge.pmd.lang.LanguageVersionDiscoverer,net.sourceforge.pmd.lang.LanguageVersionHandler,net.sourceforge.pmd.lang.Parser,net.sourceforge.pmd.lang.ast.Node</value> |
| 216 | + <value>net.sourceforge.pmd.lang.Language,net.sourceforge.pmd.lang.LanguageVersion,net.sourceforge.pmd.lang.LanguageVersionDiscoverer,net.sourceforge.pmd.lang.LanguageVersionHandler,net.sourceforge.pmd.lang.Parser,net.sourceforge.pmd.lang.ast.Node</value> |
219 | 217 | </property> |
220 | 218 | </properties> |
221 | 219 | </rule> |
|
265 | 263 | <rule ref="category/java/errorprone.xml/AssignmentInOperand"> |
266 | 264 | <priority>1</priority> |
267 | 265 | <properties> |
268 | | - <property name="allowWhile" value="true" /> |
| 266 | + <property name="allowWhile" value="true"/> |
269 | 267 | </properties> |
270 | 268 | </rule> |
271 | 269 | <rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"> |
|
329 | 327 | <rule ref="category/java/errorprone.xml/CompareObjectsWithEquals"> |
330 | 328 | <priority>1</priority> |
331 | 329 | <properties> |
332 | | - <property name="typesThatCompareByReference" |
333 | | - value="java.lang.Enum,java.lang.Class,net.sourceforge.pmd.lang.ast.Node,net.sourceforge.pmd.lang.ast.GenericToken" /> |
| 330 | + <property name="typesThatCompareByReference" value="java.lang.Enum,java.lang.Class,net.sourceforge.pmd.lang.ast.Node,net.sourceforge.pmd.lang.ast.GenericToken"/> |
334 | 331 | </properties> |
335 | 332 | </rule> |
336 | 333 | <rule ref="category/java/errorprone.xml/ComparisonWithNaN"> |
|
522 | 519 |
|
523 | 520 | <!-- PMD specific custom rules --> |
524 | 521 | <rule name="UseInstanceofToCompareClasses" |
525 | | - language="java" |
526 | | - since="5.0" |
527 | | - message="replace o.getClass().equals(MyClass.class) with o instanceof MyClass" |
528 | | - class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
| 522 | + language="java" |
| 523 | + since="5.0" |
| 524 | + message="replace o.getClass().equals(MyClass.class) with o instanceof MyClass" |
| 525 | + class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
529 | 526 | <description>replace o.getClass().equals(MyClass.class) with o instanceof MyClass. Make sure MyClass doesn't have descendants</description> |
530 | 527 | <priority>1</priority> |
531 | 528 | <properties> |
|
542 | 539 | </rule> |
543 | 540 |
|
544 | 541 | <rule name="ReversedUseInstanceofToCompareClasses" |
545 | | - language="java" |
546 | | - since="5.0" |
547 | | - message="replace MyClass.class.equals(o.getClass()) with o instanceof MyClass" |
548 | | - class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
| 542 | + language="java" |
| 543 | + since="5.0" |
| 544 | + message="replace MyClass.class.equals(o.getClass()) with o instanceof MyClass" |
| 545 | + class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
549 | 546 | <description>replace MyClass.class.equals(o.getClass()) with o instanceof MyClass. Make sure MyClass doesn't have descendants</description> |
550 | 547 | <priority>3</priority> |
551 | 548 | <properties> |
|
562 | 559 | </rule> |
563 | 560 |
|
564 | 561 | <rule name="DontCallSuperVisitWhenUsingRuleChain" |
565 | | - language="java" |
566 | | - message="Don't call super.visit() when using the rulechain" |
567 | | - typeResolution="true" |
568 | | - class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
| 562 | + language="java" |
| 563 | + message="Don't call super.visit() when using the rulechain" |
| 564 | + typeResolution="true" |
| 565 | + class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
569 | 566 | <description>Calling super.visit breaks the rulechain, by starting a full visitor run from the passed node downwards. Add all needed nodes to the rulechain instead.</description> |
570 | 567 | <priority>1</priority> |
571 | 568 | <properties> |
|
589 | 586 | </rule> |
590 | 587 |
|
591 | 588 | <rule name="AlwaysCallSuperWhenNotUsingRuleChain" |
592 | | - language="java" |
593 | | - message="Always call super.visit() when not using rulechain" |
594 | | - typeResolution="true" |
595 | | - class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
| 589 | + language="java" |
| 590 | + message="Always call super.visit() when not using rulechain" |
| 591 | + typeResolution="true" |
| 592 | + class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
596 | 593 | <description>Just returning without calling super stops visiting of nested nodes like inner classes.</description> |
597 | 594 | <priority>3</priority> |
598 | 595 | <properties> |
|
612 | 609 |
|
613 | 610 | <!-- Idea from https://github.com/pmd/pmd/pull/3609#discussion_r748292071 --> |
614 | 611 | <rule name="ReuseInvocationMatcher" |
615 | | - language="java" |
616 | | - message="Reuse InvocationMatcher" |
617 | | - typeResolution="true" |
618 | | - class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
| 612 | + language="java" |
| 613 | + message="Reuse InvocationMatcher" |
| 614 | + typeResolution="true" |
| 615 | + class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
619 | 616 | <description>Share the invocation matcher and not create a new one every time</description> |
620 | 617 | <priority>1</priority> |
621 | 618 | <properties> |
|
631 | 628 | </rule> |
632 | 629 |
|
633 | 630 | <rule name="DoNotUseJavaUtilLogging" |
634 | | - language="java" |
635 | | - since="7.0.0" |
636 | | - message="Use slf4j: LoggerFactory.getLogger(MyClass.class)" |
637 | | - class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
| 631 | + language="java" |
| 632 | + since="7.0.0" |
| 633 | + message="Use slf4j: LoggerFactory.getLogger(MyClass.class)" |
| 634 | + class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> |
638 | 635 | <description>Use slf4j: LoggerFactory.getLogger(MyClass.class)</description> |
639 | 636 | <priority>1</priority> |
640 | 637 | <properties> |
|
0 commit comments