forked from ChuckJonas/vscode-apex-pmd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
268 lines (268 loc) · 8.57 KB
/
package.json
File metadata and controls
268 lines (268 loc) · 8.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
{
"name": "apex-pmd",
"displayName": "Apex PMD",
"description": "PMD static analysis for Salesforce Apex",
"version": "0.11.0-snapshot.0",
"publisher": "chuckjonas",
"author": {
"name": "Charlie Jonas",
"email": "charlie@callawaycloudconsulting.com"
},
"engines": {
"vscode": "^1.74.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ChuckJonas/vscode-apex-pmd.git"
},
"bugs": {
"url": "https://github.com/ChuckJonas/vscode-apex-pmd/issues"
},
"icon": "images/vscode-apex-pmd.png",
"categories": [
"Linters"
],
"keywords": [
"Salesforce",
"Apex",
"Static Analysis",
"PMD"
],
"activationEvents": [
"*"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "apex-pmd.runWorkspace",
"title": "On Workspace",
"category": "Apex Static Analysis"
},
{
"command": "apex-pmd.runFile",
"title": "On File",
"category": "Apex Static Analysis"
},
{
"command": "apex-pmd.clearProblems",
"title": "Clear Problems",
"category": "Apex Static Analysis"
},
{
"command": "apex-pmd.runFileMenu",
"title": "Static Analysis On File"
}
],
"languages": [
{
"id": "apex",
"extensions": [
".apxc",
".cls",
".trigger"
],
"aliases": [
"Apex"
]
},
{
"id": "visualforce",
"extensions": [
".page",
".component"
],
"aliases": [
"VisualForce",
"Visualforce"
]
}
],
"configuration": [
{
"title": "Events",
"properties": {
"apexPMD.runOnFileOpen": {
"type": "boolean",
"default": false,
"description": "Will run static analysis every time a file is opened",
"order": 1
},
"apexPMD.runOnFileSave": {
"type": "boolean",
"default": true,
"description": "Will run static analysis every time a file is saved",
"order": 2
},
"apexPMD.runOnFileChange": {
"type": "boolean",
"default": false,
"description": "Will run static analysis every time a file is changed (with a 500ms debounce delay)",
"order": 3
},
"apexPMD.onFileChangeDebounce": {
"type": "integer",
"default": 3000,
"description": "Debounce interval to wait before running pmd after document change. Only applicable if `runOnFileChange == true`",
"order": 4
}
}
},
{
"title": "Rule Configurations",
"properties": {
"apexPMD.rulesets": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "(Optional) Paths to rulesets' xml files.",
"order": 1
},
"apexPMD.additionalClassPaths": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "(Optional) paths to be appended to classpath. Used to find jar files containing custom rule definitions. Can be absolute or relative to workspace.",
"order": 2
},
"apexPMD.apexRootDirectory": {
"type": "object",
"default": {
"mode": "off"
},
"markdownDescription": "Whether and how to set `PMD_APEX_ROOT_DIRECTORY` env variable. This variable should point to the sfdx project directory, which contains the file `sfdx-project.json`.\n\nThis is needed for the rule [UnusedMethod](https://docs.pmd-code.org/latest/pmd_rules_apex_design.html#unusedmethod) which utilizes [Apex Language Server](https://github.com/apex-dev-tools/apex-ls) which needs a well-formed sfdx project.\n\n* off (default) = Do not set `PMD_APEX_ROOT_DIRECTORY` at all\n* automatic = Automatically find the nearest `sfdx-project.json` file in a parent directory and use that directory\n* custom = Use a custom location for `PMD_APEX_ROOT_DIRECTORY` provided by \"customValue\". It should point to the directory where the `sfdx-project.json` file is located. This is only used, if the \"mode\"==\"custom\".",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string",
"enum": [
"off",
"automatic",
"custom"
],
"default": "automatic"
},
"customValue": {
"type": "string",
"default": ""
}
},
"order": 3
}
}
},
{
"title": "Violation Handling",
"properties": {
"apexPMD.priorityErrorThreshold": {
"type": "number",
"default": 1,
"description": "Determines at what priority level 'errors' will be added. Anything less will be a warning or hint"
},
"apexPMD.priorityWarnThreshold": {
"type": "number",
"default": 3,
"description": "Determines at what priority level 'warnings' will be added. Anything less will be a hint"
}
}
},
{
"title": "PMD Execution",
"properties": {
"apexPMD.jrePath": {
"type": "string",
"description": "(Optional) Path to JRE (Folder that contains which contains `bin/java`)",
"order": 1
},
"apexPMD.pmdBinPath": {
"type": "string",
"default": "",
"description": "(Optional) Path to where PMD was installed",
"order": 2
},
"apexPMD.enableCache": {
"type": "boolean",
"default": false,
"description": "Creates a cache file for PMD to run faster. Will create a .pmdCache file in your workspace",
"order": 3
},
"apexPMD.commandBufferSize": {
"type": "number",
"default": "64",
"description": "Size of buffer used to collect PMD command output (MB), may need to be increased for very large projects",
"order": 4
},
"apexPMD.enableDebugOutput": {
"type": "boolean",
"default": false,
"description": "Enable debug mode when executing PMD which gives more detailed log messages in the output channel.",
"order": 5
}
}
}
],
"menus": {
"explorer/context": [
{
"when": "resourceLangId == 'apex' || resourceLangId == 'visualforce' || resourceLangId == 'xml'",
"command": "apex-pmd.runFileMenu",
"group": "apex-pmd"
}
],
"editor/context": [
{
"when": "resourceLangId == 'apex' || resourceLangId == 'visualforce' || resourceLangId == 'xml'",
"command": "apex-pmd.runFileMenu",
"group": "apex-pmd"
}
]
}
},
"config": {
"pmdVersion": "7.15.0"
},
"scripts": {
"postinstall": "pmd-packager/upgrade.sh",
"postversion": "npm run vscode:package && git push --tags && npm run vscode:publish && git push && echo \"Successfully released version $npm_package_version!\"",
"vscode:package": "npx vsce package --allow-star-activation",
"vscode:publish": "npx vsce publish",
"vscode:prepublish": "npm run build:prod",
"build:prod": "webpack --mode production",
"build:test": "tsc",
"pretest": "npm run build:prod && npm run build:test",
"update-pmd": "pmd-packager/upgrade.sh latest",
"test": "node ./out/test/runTest.js",
"prettier": "npx prettier . --write",
"lint": "npx eslint src"
},
"devDependencies": {
"@eslint/js": "^9.28.0",
"@types/debounce": "^1.2.4",
"@types/mocha": "^10.0.10",
"@types/node": "^24.10.0",
"@types/vscode": "1.74.0",
"@typescript-eslint/eslint-plugin": "^8.29.1",
"@typescript-eslint/parser": "^8.24.1",
"@vscode/test-electron": "^2.5.2",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"glob": "^11.0.3",
"mocha": "^11.7.4",
"prettier": "^3.6.2",
"ts-loader": "^9.5.4",
"tslint": "^6.1.3",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.3",
"webpack": "^5.102.1",
"webpack-cli": "^6.0.1"
},
"dependencies": {
"csv-parse": "^6.1.0",
"debounce": "^2.2.0"
}
}