Skip to content

Commit

Permalink
chore: disable Codacy PMD rule UnnecessaryBlock for ECMAScripts (#557)
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <[email protected]>
  • Loading branch information
leninmehedy authored Nov 16, 2023
1 parent 674ac32 commit 11d20e6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/zxc-compile-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
if: ${{ (inputs.enable-unit-tests || inputs.enable-nodejs-tests) && !cancelled() && !failure() }}
with:
version: "v3.12.3" # helm version
version: "v3.12.3" # helm version

# Technically, this step is not required for the unit tests to run, but it is useful for debugging setup issues.
- name: Kubernetes Cluster Info
Expand Down Expand Up @@ -213,6 +213,14 @@ jobs:
arguments: spotlessCheck --scan
build-root-directory: fullstack-gradle-plugin

# This step is to cache the helm charts before we start unit tests
- name: Setup Helm Charts
if: ${{ (inputs.enable-unit-tests || inputs.enable-nodejs-tests) && !cancelled() && !failure() }}
run: |
helm repo add haproxytech https://haproxytech.github.io/helm-charts
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
- name: Unit Tests
id: gradle-test
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
Expand Down
25 changes: 25 additions & 0 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>

<ruleset name="Custom Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

<description>
FST custom PMD rule for Codacy analyzer
</description>


<!--
Codacy seems to fail to detect correct import statement for ECMAScripts
See:
- https://github.com/pmd/pmd/issues/2305
- https://github.com/pmd/pmd/issues/4129
-->
<rule ref="category/ecmascript/codestyle.xml">
<exclude name="UnnecessaryBlock"/>
</rule>
<rule ref="category/ecmascript/errorprone.xml"/>
<rule ref="category/ecmascript/bestpractices.xml"/>

</ruleset>

0 comments on commit 11d20e6

Please sign in to comment.