diff --git a/README.md b/README.md index 89da8b9..d110c61 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ npm install --global pmd-bin ## Usage ```console -pmd -help +pmd --help ``` ## Maintenance diff --git a/download-pmd.js b/download-pmd.js index 2aca648..6610398 100644 --- a/download-pmd.js +++ b/download-pmd.js @@ -5,7 +5,7 @@ async function cleanDist() { async function downloadPmd() { const pmdVer = require("./package.json").pmd.version; - const url = `https://github.com/pmd/pmd/releases/download/pmd_releases%2F${pmdVer}/pmd-bin-${pmdVer}.zip`; + const url = `https://github.com/pmd/pmd/releases/download/pmd_releases%2F${pmdVer}/pmd-dist-${pmdVer}-bin.zip`; const response = await fetch(url); return Buffer.from(await response.arrayBuffer(), "binary"); } diff --git a/fixtures/valid/Foo.cls b/fixtures/valid/Foo.cls index bd2efcb..3d3afcd 100644 --- a/fixtures/valid/Foo.cls +++ b/fixtures/valid/Foo.cls @@ -1,3 +1,6 @@ +/** + * @description this is a valid apexdoc comment + */ public class Foo { public static final Integer MY_NUM = 0; public String myTest = ''; diff --git a/package.json b/package.json index 181023e..2f7ab58 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "license": "BSD", "main": "pmd", "pmd": { - "version": "6.55.0" + "version": "7.0.0" }, "repository": { "type": "git", diff --git a/pmd b/pmd index 9abd783..32fab79 100755 --- a/pmd +++ b/pmd @@ -4,7 +4,7 @@ const path = require("path"); const jre = require("node-java-connector"); async function main() { - const className = "net.sourceforge.pmd.PMD"; + const className = "net.sourceforge.pmd.cli.PmdCli"; const classPath = [ path.resolve(__dirname, "dist", "pmd-bin", "lib", "*"), ]; diff --git a/test.sh b/test.sh index 0dd6ea8..c4a4a62 100644 --- a/test.sh +++ b/test.sh @@ -7,18 +7,18 @@ set -eo errexit ret=0; echo -n "it should succeed linting valid apex code... " -if ! pmd -dir ./fixtures/valid -rulesets apex-style -language apex > /dev/null; then +if ! pmd check --dir ./fixtures/valid --use-version apex-55 --rulesets rulesets/apex/quickstart.xml > /dev/null; then echo "failed" ret=1; -else +else echo "OK" fi echo -n "it should fail linting invalid apex code... " -if pmd -dir ./fixtures/invalid -rulesets apex-style -language apex > /dev/null; then +if pmd check --dir ./fixtures/invalid --use-version apex-55 --rulesets rulesets/apex/quickstart.xml > /dev/null; then echo "failed" ret=1; -else +else echo "OK" fi