From c582b7fc1f5909e13d5bc4e2a1d398239f53665e Mon Sep 17 00:00:00 2001 From: mahfouz72 Date: Thu, 9 May 2024 15:43:55 +0300 Subject: [PATCH] supplemental: suppress PMD violations --- config/pmd-test.xml | 31 ++++- config/pmd.xml | 125 +++++++++++++++++- .../checks/imports/ImportOrderCheckTest.java | 2 +- 3 files changed, 153 insertions(+), 5 deletions(-) diff --git a/config/pmd-test.xml b/config/pmd-test.xml index 772ed4208aa..e0d61b18740 100644 --- a/config/pmd-test.xml +++ b/config/pmd-test.xml @@ -95,10 +95,20 @@ assertion calls are not required as they are called by the library. In MainTest PMD does not find asserts in lambdas called in the method invokeAndWait. --> + + //MethodDeclaration[@Name='testGetValueAtDetailNode'] + | //ClassDeclaration[@SimpleName='ClassImportRuleTest'] + | //ClassDeclaration[@SimpleName='PkgImportRuleTest'] + | //ClassDeclaration[@SimpleName='PkgImportControlTest'] + //MethodDeclaration[ends-with(@Name, 'CheckAccess')] + | //ClassDeclaration[@SimpleName='JavadocTagInfoTest'] + //MethodDeclaration[@Name='testCoverage'] + | //ClassDeclaration[@SimpleName='AstRegressionTest'] + //MethodDeclaration[@Name='testCustomAstTree']"/> @@ -198,9 +218,16 @@ + + //MethodDeclaration[@Name='getResultWithLimitedResources'] + | //ClassDeclaration[@SimpleName='SuppressionFilterTest'] + //MethodDeclaration[@Name='isConnectionAvailableAndStable'] + | //ClassDeclaration[@SimpleName='SuppressionsLoaderTest'] + //MethodDeclaration[@Name='loadFilterSet']"/> diff --git a/config/pmd.xml b/config/pmd.xml index 87aea4c347b..46e62a6d1b8 100644 --- a/config/pmd.xml +++ b/config/pmd.xml @@ -14,6 +14,28 @@ + + + + + + @@ -39,6 +61,42 @@ or @SimpleName='JavadocPropertiesGenerator']"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + value="//ClassDeclaration[@SimpleName='ExitHelper'] + | //ClassDeclaration[@SimpleName='MainTest'] + //MethodDeclaration[@Name='assertMainReturnCode'] "/> + + + + + + @@ -252,9 +338,13 @@ + + or @SimpleName='SiteUtil' or @SimpleName='Checker' or @SimpleName='JavaAstVisitor' + or @SimpleName='Main' or @SimpleName='TreeWalker' or @SimpleName='CheckstyleAntTask' + or @SimpleName='TranslationCheck' or @SimpleName='JavadocMethodCheck']"/> @@ -372,6 +462,13 @@ //MethodDeclaration[@Name='getDescriptionFromJavadoc']"/> + + + + + + @@ -395,6 +492,30 @@ + + + + + + + + + + + + + !((boolean) lastImportStatic))) + lastImportStatic -> !(boolean) lastImportStatic)) .isTrue(); }