Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: disable Codacy PMD rule UnnecessaryBlock for ECMAScripts #557

Merged
merged 6 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>