-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pmd released [7.0.0](https://github.com/pmd/pmd/releases/tag/pmd_releases%2F7.0.0), which includes some expansions on their CLI and better support for Java (migration guide [here](https://docs.pmd-code.org/pmd-doc-7.0.0/pmd_userdocs_migrating_to_pmd7.html)). Updates the download, commands, and snapshot. Commands are first-match, so 7.0.0 works cleanly on all platforms.
- Loading branch information
1 parent
c6a3a87
commit bd33b4d
Showing
5 changed files
with
239 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import { linterCheckTest } from "tests"; | ||
import semver from "semver"; | ||
import { customLinterCheckTest } from "tests"; | ||
import { TEST_DATA } from "tests/utils"; | ||
|
||
linterCheckTest({ | ||
const versionGreaterThanOrEqual = (a: string, b: string) => { | ||
const normalizedA = a.replace("pmd_releases/", ""); | ||
const normalizedB = b.replace("pmd_releases/", ""); | ||
return semver.gte(normalizedA, normalizedB); | ||
}; | ||
|
||
customLinterCheckTest({ | ||
linterName: "pmd", | ||
args: TEST_DATA, | ||
versionGreaterThanOrEqual, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Testing linter pmd test CUSTOM 1`] = ` | ||
{ | ||
"issues": [ | ||
{ | ||
"code": "ApexDoc", | ||
"column": "8", | ||
"file": "test_data/apex.in.cls", | ||
"issueClass": "ISSUE_CLASS_EXISTING", | ||
"level": "LEVEL_HIGH", | ||
"line": "1", | ||
"linter": "pmd", | ||
"message": "Missing ApexDoc comment", | ||
"ranges": [ | ||
{ | ||
"filePath": "test_data/apex.in.cls", | ||
"length": "69", | ||
"offset": "7", | ||
}, | ||
], | ||
"targetType": "apex", | ||
}, | ||
{ | ||
"code": "AvoidGlobalModifier", | ||
"column": "8", | ||
"file": "test_data/apex.in.cls", | ||
"issueClass": "ISSUE_CLASS_EXISTING", | ||
"level": "LEVEL_HIGH", | ||
"line": "1", | ||
"linter": "pmd", | ||
"message": "Avoid using global modifier", | ||
"ranges": [ | ||
{ | ||
"filePath": "test_data/apex.in.cls", | ||
"length": "69", | ||
"offset": "7", | ||
}, | ||
], | ||
"targetType": "apex", | ||
}, | ||
{ | ||
"code": "ApexDoc", | ||
"column": "8", | ||
"file": "test_data/apex.in.cls", | ||
"issueClass": "ISSUE_CLASS_EXISTING", | ||
"level": "LEVEL_HIGH", | ||
"line": "2", | ||
"linter": "pmd", | ||
"message": "Missing ApexDoc comment", | ||
"ranges": [ | ||
{ | ||
"filePath": "test_data/apex.in.cls", | ||
"length": "41", | ||
"offset": "33", | ||
}, | ||
], | ||
"targetType": "apex", | ||
}, | ||
{ | ||
"code": "NoPackage", | ||
"column": "1", | ||
"file": "test_data/hello.in.java", | ||
"issueClass": "ISSUE_CLASS_EXISTING", | ||
"level": "LEVEL_HIGH", | ||
"line": "3", | ||
"linter": "pmd", | ||
"message": "All classes, interfaces, enums and annotations must belong to a named package", | ||
"ranges": [ | ||
{ | ||
"filePath": "test_data/hello.in.java", | ||
"length": "5", | ||
"offset": "23", | ||
}, | ||
], | ||
"targetType": "java", | ||
}, | ||
{ | ||
"code": "UseUtilityClass", | ||
"column": "1", | ||
"file": "test_data/hello.in.java", | ||
"issueClass": "ISSUE_CLASS_EXISTING", | ||
"level": "LEVEL_HIGH", | ||
"line": "3", | ||
"linter": "pmd", | ||
"message": "This utility class has a non-private constructor", | ||
"ranges": [ | ||
{ | ||
"filePath": "test_data/hello.in.java", | ||
"length": "5", | ||
"offset": "23", | ||
}, | ||
], | ||
"targetType": "java", | ||
}, | ||
], | ||
"lintActions": [ | ||
{ | ||
"command": "lint-apex", | ||
"fileGroupName": "apex", | ||
"linter": "pmd", | ||
"paths": [ | ||
"test_data/apex.in.cls", | ||
], | ||
"verb": "TRUNK_VERB_CHECK", | ||
}, | ||
{ | ||
"command": "lint-apex", | ||
"fileGroupName": "apex", | ||
"linter": "pmd", | ||
"paths": [ | ||
"test_data/apex.in.cls", | ||
], | ||
"upstream": true, | ||
"verb": "TRUNK_VERB_CHECK", | ||
}, | ||
{ | ||
"command": "lint-java", | ||
"fileGroupName": "java", | ||
"linter": "pmd", | ||
"paths": [ | ||
"test_data/hello.in.java", | ||
], | ||
"verb": "TRUNK_VERB_CHECK", | ||
}, | ||
{ | ||
"command": "lint-java", | ||
"fileGroupName": "java", | ||
"linter": "pmd", | ||
"paths": [ | ||
"test_data/hello.in.java", | ||
], | ||
"upstream": true, | ||
"verb": "TRUNK_VERB_CHECK", | ||
}, | ||
], | ||
"taskFailures": [], | ||
"unformattedFiles": [], | ||
} | ||
`; |