Skip to content

Commit 4ce5ad5

Browse files
coling01ravi kakumanu
authored andcommitted
chore: enabled pmd to fail pipeline
1 parent aab0881 commit 4ce5ad5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/pmd-ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<exclude name="UnitTestAssertionsShouldIncludeMessage"/>
1919
<exclude name="UnitTestContainsTooManyAsserts"/>
2020
<exclude name="PreserveStackTrace"/>
21+
<exclude name="ImplicitFunctionalInterface"/>
2122
</rule>
2223
<rule ref="category/java/codestyle.xml">
2324
<exclude name="AtLeastOneConstructor"/>

.github/workflows/code-analysis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ jobs:
2323
with:
2424
rulesets: '.github/pmd-ruleset.xml'
2525
sourcePath: 'src/main/java'
26+
analyzeModifiedFilesOnly: false
2627

2728
- name: Fail build if there are violations
28-
if: steps.pmd.outputs.violations != 0
29-
run: exit 1
29+
if: always()
30+
run: |
31+
VIOLATIONS="${{ steps.pmd.outputs.violations }}"
32+
if [ -n "$VIOLATIONS" ] && [ "$VIOLATIONS" != "0" ]; then
33+
echo "PMD found $VIOLATIONS violations"
34+
exit 1
35+
fi

0 commit comments

Comments
 (0)