Skip to content

Commit

Permalink
Fix ruleset and try to report pmd violations as pr comment
Browse files Browse the repository at this point in the history
Because I don't like scrolling
  • Loading branch information
mprins committed Apr 26, 2024
1 parent 9eb01c1 commit 0c258f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
run: |
mvn -B -ntp -nsu -U -T4 -fae -Dspotless.action=check -Dpom.fmt.action=verify -DskipTests -Prelease,communityRelease -f src/community/pom.xml clean install
- name: Remove SNAPSHOT jars from repository
if: always()
run: |
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
- uses: lcollins/pmd-github-action@v2
if: always()
with:
path: '**/pmd.xml'
4 changes: 2 additions & 2 deletions build/qa/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GeoTools ruleset. See https://pmd.github.io/latest/pmd_userdocs_understanding_ru
<!-- The rule reports false positives for closeable arguments that are used -->
<!-- closed within the method body. This suppression tries to avoid false positives for -->
<!-- this case, until we can switch to Java 9 and just use try(variable) {...} without -->
<!-- the need to instatiate the variable in the try -->
<!-- the need to instantiate the variable in the try -->
<property name="violationSuppressXPath">
<value>
<![CDATA[
Expand All @@ -46,7 +46,7 @@ GeoTools ruleset. See https://pmd.github.io/latest/pmd_userdocs_understanding_ru
]
[ pmd-java:typeIs('java.lang.AutoCloseable') and
fn:substring-before(@Image, '.') = ancestor::MethodDeclaration/MethodDeclarator//VariableDeclaratorId/@Name
]"/>
]
]]>
</value>
</property>
Expand Down

0 comments on commit 0c258f7

Please sign in to comment.