Skip to content

Commit

Permalink
feat: update PMD to v7
Browse files Browse the repository at this point in the history
BREAKING CHANGE: PMD 7 is a major release. Please read the [detailed release notes](https://docs.pmd-code.org/pmd-doc-7.0.0/pmd_release_notes_pmd7.html) and [migration guide](https://docs.pmd-code.org/pmd-doc-7.0.0/pmd_userdocs_migrating_to_pmd7.html) before upgrading.
  • Loading branch information
amtrack authored Apr 2, 2024
2 parents e1fc45b + f131507 commit 83db175
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ npm install --global pmd-bin
## Usage

```console
pmd -help
pmd --help
```

## Maintenance
Expand Down
2 changes: 1 addition & 1 deletion download-pmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
3 changes: 3 additions & 0 deletions fixtures/valid/Foo.cls
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @description this is a valid apexdoc comment
*/
public class Foo {
public static final Integer MY_NUM = 0;
public String myTest = '';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"license": "BSD",
"main": "pmd",
"pmd": {
"version": "6.55.0"
"version": "7.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion pmd
Original file line number Diff line number Diff line change
Expand Up @@ -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", "*"),
];
Expand Down
8 changes: 4 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 83db175

Please sign in to comment.