@terafina/tffa-sfdx-plugin 2.3.1 → 14.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/bin/pmd/apex_ruleset.xml +143 -0
- package/bin/pmd/apex_test_ruleset.xml +36 -0
- package/bin/pmd/lib/animal-sniffer-annotations-1.14.jar +0 -0
- package/bin/pmd/lib/antlr-2.7.7.jar +0 -0
- package/bin/pmd/lib/antlr-runtime-3.5.2.jar +0 -0
- package/bin/pmd/lib/antlr4-runtime-4.7.2.jar +0 -0
- package/bin/pmd/lib/aopalliance-1.0.jar +0 -0
- package/bin/pmd/lib/asm-9.2.jar +0 -0
- package/bin/pmd/lib/cglib-3.3.0.jar +0 -0
- package/bin/pmd/lib/common_2.13-4.2.0.jar +0 -0
- package/bin/pmd/lib/commons-lang3-3.8.1.jar +0 -0
- package/bin/pmd/lib/error_prone_annotations-2.1.3.jar +0 -0
- package/bin/pmd/lib/gson-2.8.9.jar +0 -0
- package/bin/pmd/lib/j2objc-annotations-1.1.jar +0 -0
- package/bin/pmd/lib/javax.inject-1.jar +0 -0
- package/bin/pmd/lib/jcommander-1.48.jar +0 -0
- package/bin/pmd/lib/jol-core-0.4.jar +0 -0
- package/bin/pmd/lib/jsr305-3.0.2.jar +0 -0
- package/bin/pmd/lib/logback-classic-1.2.9.jar +0 -0
- package/bin/pmd/lib/logback-core-1.2.9.jar +0 -0
- package/bin/pmd/lib/pmd-apex-6.47.0.jar +0 -0
- package/bin/pmd/lib/pmd-apex-jorje-6.47.0-lib.jar +0 -0
- package/bin/pmd/lib/pmd-apex-jorje-6.47.0.pom +140 -0
- package/bin/pmd/lib/pmd-core-6.47.0.jar +0 -0
- package/bin/pmd/lib/rhino-1.7.14.jar +0 -0
- package/bin/pmd/lib/saxon-9.1.0.8-dom.jar +0 -0
- package/bin/pmd/lib/saxon-9.1.0.8.jar +0 -0
- package/bin/pmd/lib/slf4j-api-1.7.32.jar +0 -0
- package/bin/pmd/lib/snakeyaml-1.30.jar +0 -0
- package/bin/pmd/lib/stringtemplate-3.2.1.jar +0 -0
- package/bin/update.sh +49 -0
- package/lib/commands/tffa/lint.d.ts +2 -0
- package/lib/commands/tffa/lint.js +14 -1
- package/lib/commands/tffa/lint.js.map +1 -1
- package/lib/shared/lint/apex-class-lint.js +1 -1
- package/lib/shared/lint/apex-class-lint.js.map +1 -1
- package/lib/shared/lint/apex-pmd.d.ts +8 -0
- package/lib/shared/lint/apex-pmd.js +124 -0
- package/lib/shared/lint/apex-pmd.js.map +1 -0
- package/lib/shared/lint/ignored-files.d.ts +1 -0
- package/lib/shared/lint/ignored-files.js +13 -2
- package/lib/shared/lint/ignored-files.js.map +1 -1
- package/lib/shared/utils/jreSetupManager.d.ts +17 -0
- package/lib/shared/utils/jreSetupManager.js +135 -0
- package/lib/shared/utils/jreSetupManager.js.map +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -3
- package/bin/run +0 -4
- package/bin/run.cmd +0 -3
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ $ npm install -g @terafina/tffa-sfdx-plugin
|
|
|
41
41
|
$ sfdx COMMAND
|
|
42
42
|
running command...
|
|
43
43
|
$ sfdx (--version|-v)
|
|
44
|
-
@terafina/tffa-sfdx-plugin/
|
|
44
|
+
@terafina/tffa-sfdx-plugin/14.0.0-rc.1 linux-x64 node-v16.13.1
|
|
45
45
|
$ sfdx --help [COMMAND]
|
|
46
46
|
USAGE
|
|
47
47
|
$ sfdx COMMAND
|
|
@@ -54,7 +54,7 @@ USAGE
|
|
|
54
54
|
<!-- commands -->
|
|
55
55
|
* [`sfdx help [COMMAND]`](#sfdx-help-command)
|
|
56
56
|
* [`sfdx tffa:apexdoc [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffaapexdoc--d-directory---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
57
|
-
* [`sfdx tffa:lint [-s <directory>] [-m <integer>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffalint--s-directory--m-integer--j---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
57
|
+
* [`sfdx tffa:lint [-s <directory>] [-m <integer>] [-p] [-r <filepath>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffalint--s-directory--m-integer--p--r-filepath--j---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
58
58
|
* [`sfdx tffa:meta [-s <directory>] [-d <directory>] [-c <directory>] [-o json|csv|human] [-f] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffameta--s-directory--d-directory--c-directory--o-jsoncsvhuman--f---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
59
59
|
* [`sfdx tffa:ping [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffaping---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
60
60
|
* [`sfdx version`](#sfdx-version)
|
|
@@ -102,21 +102,23 @@ EXAMPLES
|
|
|
102
102
|
Generate Apex API Documentation : $sfdx tffa:apexdoc
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
_See code: [src/commands/tffa/apexdoc.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
105
|
+
_See code: [src/commands/tffa/apexdoc.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v14.0.0-rc.1/src/commands/tffa/apexdoc.ts)_
|
|
106
106
|
|
|
107
|
-
## `sfdx tffa:lint [-s <directory>] [-m <integer>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
107
|
+
## `sfdx tffa:lint [-s <directory>] [-m <integer>] [-p] [-r <filepath>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
108
108
|
|
|
109
109
|
scan a sfdx project and provide a violations report based on defined standards
|
|
110
110
|
|
|
111
111
|
```
|
|
112
112
|
USAGE
|
|
113
|
-
$ sfdx tffa:lint [-s <directory>] [-m <integer>] [-j] [--loglevel
|
|
113
|
+
$ sfdx tffa:lint [-s <directory>] [-m <integer>] [-p] [-r <filepath>] [-j] [--loglevel
|
|
114
114
|
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
115
115
|
|
|
116
116
|
FLAGS
|
|
117
117
|
-j, --json generate json output
|
|
118
118
|
-m, --minapi=<value> [default: 53] minimum api version to
|
|
119
119
|
use during quality checks
|
|
120
|
+
-p, --pmd generate pmd output
|
|
121
|
+
-r, --rulesetpath=<value> path to pmd ruleset
|
|
120
122
|
-s, --sourcefolder=<value> [default: .] directory containing
|
|
121
123
|
sfdx project
|
|
122
124
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
@@ -129,7 +131,7 @@ EXAMPLES
|
|
|
129
131
|
Scan a sfdx project and provide list of code violations : $sfdx tffa:scan
|
|
130
132
|
```
|
|
131
133
|
|
|
132
|
-
_See code: [src/commands/tffa/lint.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
134
|
+
_See code: [src/commands/tffa/lint.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v14.0.0-rc.1/src/commands/tffa/lint.ts)_
|
|
133
135
|
|
|
134
136
|
## `sfdx tffa:meta [-s <directory>] [-d <directory>] [-c <directory>] [-o json|csv|human] [-f] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
135
137
|
|
|
@@ -158,7 +160,7 @@ EXAMPLES
|
|
|
158
160
|
scan a sfdx project for metadata : $sfdx tffa:meta
|
|
159
161
|
```
|
|
160
162
|
|
|
161
|
-
_See code: [src/commands/tffa/meta.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
163
|
+
_See code: [src/commands/tffa/meta.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v14.0.0-rc.1/src/commands/tffa/meta.ts)_
|
|
162
164
|
|
|
163
165
|
## `sfdx tffa:ping [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
164
166
|
|
|
@@ -180,7 +182,7 @@ EXAMPLES
|
|
|
180
182
|
$ sfdx tffa:ping
|
|
181
183
|
```
|
|
182
184
|
|
|
183
|
-
_See code: [src/commands/tffa/ping.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
185
|
+
_See code: [src/commands/tffa/ping.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v14.0.0-rc.1/src/commands/tffa/ping.ts)_
|
|
184
186
|
|
|
185
187
|
## `sfdx version`
|
|
186
188
|
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<ruleset
|
|
3
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
5
|
+
name="TFFA ruleset for Salesforce.com Apex"
|
|
6
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"
|
|
7
|
+
>
|
|
8
|
+
<description>TFFA ruleset for Salesforce.com Apex</description>
|
|
9
|
+
<exclude-pattern>.*</exclude-pattern>
|
|
10
|
+
<include-pattern>.*/app/main/default/classes/.*</include-pattern>
|
|
11
|
+
<include-pattern>.*/app/main/default/triggers/.*</include-pattern>
|
|
12
|
+
<!--SECURITY -->
|
|
13
|
+
<rule ref="category/apex/security.xml">
|
|
14
|
+
<priority>1</priority>
|
|
15
|
+
<exclude name="ApexOpenRedirect" />
|
|
16
|
+
<exclude name="ApexBadCrypto" />
|
|
17
|
+
<exclude name="ApexSuggestUsingNamedCred" />
|
|
18
|
+
</rule>
|
|
19
|
+
<!--SECURITY -->
|
|
20
|
+
<!--DESIGN -->
|
|
21
|
+
<rule ref="category/apex/design.xml">
|
|
22
|
+
<exclude name="StdCyclomaticComplexity" />
|
|
23
|
+
<exclude name="ExcessivePublicCount" />
|
|
24
|
+
<exclude name="CyclomaticComplexity" />
|
|
25
|
+
<exclude name="CognitiveComplexity" />
|
|
26
|
+
<exclude name="TooManyFields" />
|
|
27
|
+
<exclude name="NcssMethodCount" />
|
|
28
|
+
<exclude name="NcssConstructorCount" />
|
|
29
|
+
<exclude name="ExcessiveParameterList" />
|
|
30
|
+
<exclude name="NcssTypeCount" />
|
|
31
|
+
<exclude name="ExcessiveClassLength" />
|
|
32
|
+
<exclude name="AvoidDeeplyNestedIfStmts" />
|
|
33
|
+
</rule>
|
|
34
|
+
<rule ref="category/apex/design.xml/AvoidDeeplyNestedIfStmts" message="Deeply nested if..else statements are hard to read">
|
|
35
|
+
<priority>3</priority>
|
|
36
|
+
<properties>
|
|
37
|
+
<property name="problemDepth" value="10" />
|
|
38
|
+
</properties>
|
|
39
|
+
</rule>
|
|
40
|
+
<rule ref="category/apex/design.xml/ExcessiveClassLength" message="Avoid really long classes (lines of code)">
|
|
41
|
+
<priority>3</priority>
|
|
42
|
+
<properties>
|
|
43
|
+
<property name="minimum" value="4000" />
|
|
44
|
+
</properties>
|
|
45
|
+
</rule>
|
|
46
|
+
<rule ref="category/apex/design.xml/NcssTypeCount" message="The type has an NCSS line count of {0}">
|
|
47
|
+
<priority>3</priority>
|
|
48
|
+
<properties>
|
|
49
|
+
<property name="minimum" value="1500" />
|
|
50
|
+
</properties>
|
|
51
|
+
</rule>
|
|
52
|
+
<!--DESIGN -->
|
|
53
|
+
<!-- BEST PRACTICES -->
|
|
54
|
+
<rule ref="category/apex/bestpractices.xml">
|
|
55
|
+
<exclude name="ApexAssertionsShouldIncludeMessage" />
|
|
56
|
+
<exclude name="AvoidGlobalModifier" />
|
|
57
|
+
<exclude name="UnusedLocalVariable" />
|
|
58
|
+
<exclude name="DebugsShouldUseLoggingLevel" />
|
|
59
|
+
|
|
60
|
+
</rule>
|
|
61
|
+
<!-- BEST PRACTICES -->
|
|
62
|
+
<!-- DOCUMENTATION -->
|
|
63
|
+
<rule ref="category/apex/documentation.xml">
|
|
64
|
+
<exclude name="ApexDoc" />
|
|
65
|
+
</rule>
|
|
66
|
+
<!-- DOCUMENTATION -->
|
|
67
|
+
<!-- PERFORMANCE -->
|
|
68
|
+
<rule ref="category/apex/performance.xml">
|
|
69
|
+
<exclude name="EagerlyLoadedDescribeSObjectResult" />
|
|
70
|
+
<exclude name="AvoidDebugStatements" />
|
|
71
|
+
</rule>
|
|
72
|
+
<rule ref="category/apex/performance.xml/AvoidDebugStatements" message="Avoid System.debug statements use tffa.Logger instead">
|
|
73
|
+
<priority>3</priority>
|
|
74
|
+
<properties />
|
|
75
|
+
</rule>
|
|
76
|
+
<!-- PERFORMANCE -->
|
|
77
|
+
<!-- CODE STYLE -->
|
|
78
|
+
<rule ref="category/apex/codestyle.xml">
|
|
79
|
+
<priority>3</priority>
|
|
80
|
+
<exclude name="FieldDeclarationsShouldBeAtStart" />
|
|
81
|
+
<exclude name="IfElseStmtsMustUseBraces" />
|
|
82
|
+
<exclude name="IfStmtsMustUseBraces" />
|
|
83
|
+
<exclude name="MethodNamingConventions" />
|
|
84
|
+
<exclude name="FieldNamingConventions" />
|
|
85
|
+
<exclude name="PropertyNamingConventions" />
|
|
86
|
+
<exclude name="FormalParameterNamingConventions" />
|
|
87
|
+
<exclude name="LocalVariableNamingConventions" />
|
|
88
|
+
|
|
89
|
+
</rule>
|
|
90
|
+
<rule ref="category/apex/codestyle.xml/MethodNamingConventions" message="Method name does not begin with a lower case character.">
|
|
91
|
+
<priority>3</priority>
|
|
92
|
+
<properties>
|
|
93
|
+
<property name="testPattern" value="[a-zA-Z0-9_]*" />
|
|
94
|
+
<property name="staticPattern" value="[a-zA-Z0-9_]*" />
|
|
95
|
+
<property name="instancePattern" value="[a-zA-Z0-9_]*" />
|
|
96
|
+
</properties>
|
|
97
|
+
</rule>
|
|
98
|
+
<rule ref="category/apex/codestyle.xml/FieldNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
99
|
+
<priority>3</priority>
|
|
100
|
+
<properties>
|
|
101
|
+
<property name="enumConstantPattern" value="[A-Z][a-zA-Z0-9_]*" />
|
|
102
|
+
<property name="constantPattern" value="[a-zA-Z0-9_]*" />
|
|
103
|
+
<property name="finalPattern" value="[a-zA-Z0-9_]*" />
|
|
104
|
+
<property name="staticPattern" value="[a-zA-Z0-9_]*" />
|
|
105
|
+
<property name="instancePattern" value="[a-zA-Z][a-zA-Z0-9_]*" />
|
|
106
|
+
</properties>
|
|
107
|
+
</rule>
|
|
108
|
+
<rule ref="category/apex/codestyle.xml/PropertyNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
109
|
+
<priority>3</priority>
|
|
110
|
+
<properties>
|
|
111
|
+
<property name="staticPattern" value="[a-zA-Z][a-z_A-Z0-9]*" />
|
|
112
|
+
<property name="instancePattern" value="[a-zA-Z][a-z_A-Z0-9]*" />
|
|
113
|
+
</properties>
|
|
114
|
+
</rule>
|
|
115
|
+
<rule ref="category/apex/codestyle.xml/FormalParameterNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
116
|
+
<priority>3</priority>
|
|
117
|
+
<properties>
|
|
118
|
+
<property name="finalMethodParameterPattern" value="[a-z][a-zA-Z0-9]*" />
|
|
119
|
+
<property name="methodParameterPattern" value="[a-z][a-zA-Z0-9_]*" />
|
|
120
|
+
</properties>
|
|
121
|
+
</rule>
|
|
122
|
+
<rule ref="category/apex/codestyle.xml/LocalVariableNamingConventions" message="The {0} name doesn''t match ''{2}''">
|
|
123
|
+
<priority>3</priority>
|
|
124
|
+
<properties>
|
|
125
|
+
<property name="finalLocalPattern" value="[a-z][a-zA-Z0-9]*" />
|
|
126
|
+
<property name="localPattern" value="[a-z][a-zA-Z0-9]*" />
|
|
127
|
+
</properties>
|
|
128
|
+
</rule>
|
|
129
|
+
<!-- CODE STYLE -->
|
|
130
|
+
<!-- ERROR PRONE -->
|
|
131
|
+
<rule ref="category/apex/errorprone.xml">
|
|
132
|
+
<exclude name="EmptyCatchBlock" />
|
|
133
|
+
<exclude name="EmptyStatementBlock" />
|
|
134
|
+
</rule>
|
|
135
|
+
<rule ref="category/apex/errorprone.xml/EmptyCatchBlock" message="Avoid empty catch blocks">
|
|
136
|
+
<priority>3</priority>
|
|
137
|
+
<properties>
|
|
138
|
+
<property name="allowCommentedBlocks" value="true" />
|
|
139
|
+
<property name="allowExceptionNameRegex" value="^(ignored|expected)$" />
|
|
140
|
+
</properties>
|
|
141
|
+
</rule>
|
|
142
|
+
<!-- END ERROR PRONE -->
|
|
143
|
+
</ruleset>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<ruleset
|
|
3
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
5
|
+
name="TFFA ruleset for Salesforce.com Apex tests"
|
|
6
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"
|
|
7
|
+
>
|
|
8
|
+
<description>TFFA ruleset for Salesforce.com Apex tests</description>
|
|
9
|
+
<exclude-pattern>.*</exclude-pattern>
|
|
10
|
+
<include-pattern>.*/app/test/default/classes/.*</include-pattern>
|
|
11
|
+
<!-- BEST PRACTICES -->
|
|
12
|
+
<rule ref="category/apex/bestpractices.xml">
|
|
13
|
+
<priority>1</priority>
|
|
14
|
+
<exclude name="ApexAssertionsShouldIncludeMessage" />
|
|
15
|
+
<exclude name="AvoidGlobalModifier" />
|
|
16
|
+
<exclude name="UnusedLocalVariable" />
|
|
17
|
+
<exclude name="DebugsShouldUseLoggingLevel" />
|
|
18
|
+
</rule>
|
|
19
|
+
<!-- BEST PRACTICES -->
|
|
20
|
+
<!-- ERROR PRONE -->
|
|
21
|
+
<rule ref="category/apex/errorprone.xml">
|
|
22
|
+
<exclude name="EmptyCatchBlock" />
|
|
23
|
+
<exclude name="EmptyStatementBlock" />
|
|
24
|
+
<exclude name="AvoidHardcodingId" />
|
|
25
|
+
</rule>
|
|
26
|
+
<rule ref="category/apex/errorprone.xml/EmptyCatchBlock" message="Avoid empty catch blocks">
|
|
27
|
+
<priority>3</priority>
|
|
28
|
+
<properties>
|
|
29
|
+
<property name="allowCommentedBlocks" value="true" />
|
|
30
|
+
<property name="allowExceptionNameRegex" value="^(ignored|expected)$" />
|
|
31
|
+
</properties>
|
|
32
|
+
</rule>
|
|
33
|
+
<!-- END ERROR PRONE -->
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
</ruleset>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
3
|
+
<modelVersion>4.0.0</modelVersion>
|
|
4
|
+
<artifactId>pmd-apex-jorje</artifactId>
|
|
5
|
+
<name>PMD Apex Jorje Parser Library</name>
|
|
6
|
+
<packaging>pom</packaging>
|
|
7
|
+
|
|
8
|
+
<parent>
|
|
9
|
+
<groupId>net.sourceforge.pmd</groupId>
|
|
10
|
+
<artifactId>pmd</artifactId>
|
|
11
|
+
<version>6.47.0</version>
|
|
12
|
+
<relativePath>../pom.xml</relativePath>
|
|
13
|
+
</parent>
|
|
14
|
+
|
|
15
|
+
<properties>
|
|
16
|
+
<java.version>8</java.version>
|
|
17
|
+
<apex.jorje.version>2021-10-08-631b8c</apex.jorje.version>
|
|
18
|
+
</properties>
|
|
19
|
+
|
|
20
|
+
<build>
|
|
21
|
+
<plugins>
|
|
22
|
+
<plugin>
|
|
23
|
+
<groupId>org.codehaus.mojo</groupId>
|
|
24
|
+
<artifactId>build-helper-maven-plugin</artifactId>
|
|
25
|
+
<version>3.0.0</version>
|
|
26
|
+
<executions>
|
|
27
|
+
<execution>
|
|
28
|
+
<id>attach-apex-jorje</id>
|
|
29
|
+
<phase>package</phase>
|
|
30
|
+
<goals>
|
|
31
|
+
<goal>attach-artifact</goal>
|
|
32
|
+
</goals>
|
|
33
|
+
<configuration>
|
|
34
|
+
<artifacts>
|
|
35
|
+
<artifact>
|
|
36
|
+
<file>${basedir}/repo/apex/apex-jorje-lsp-minimized/${apex.jorje.version}/apex-jorje-lsp-minimized-${apex.jorje.version}.jar</file>
|
|
37
|
+
<type>jar</type>
|
|
38
|
+
<classifier>lib</classifier>
|
|
39
|
+
</artifact>
|
|
40
|
+
</artifacts>
|
|
41
|
+
</configuration>
|
|
42
|
+
</execution>
|
|
43
|
+
</executions>
|
|
44
|
+
</plugin>
|
|
45
|
+
</plugins>
|
|
46
|
+
</build>
|
|
47
|
+
<dependencies>
|
|
48
|
+
<!-- transitive dependencies of apex-jorje -->
|
|
49
|
+
<dependency>
|
|
50
|
+
<groupId>cglib</groupId>
|
|
51
|
+
<artifactId>cglib</artifactId>
|
|
52
|
+
<version>3.3.0</version> <!-- apex jorje actually depends on 3.2.0 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
53
|
+
</dependency>
|
|
54
|
+
<dependency>
|
|
55
|
+
<groupId>ch.qos.logback</groupId>
|
|
56
|
+
<artifactId>logback-classic</artifactId>
|
|
57
|
+
<version>1.2.9</version> <!-- apex jorje actually depends on 1.1.7 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
58
|
+
</dependency>
|
|
59
|
+
<dependency>
|
|
60
|
+
<groupId>ch.qos.logback</groupId>
|
|
61
|
+
<artifactId>logback-core</artifactId>
|
|
62
|
+
<version>1.2.9</version> <!-- apex jorje actually depends on 1.1.7 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
63
|
+
</dependency>
|
|
64
|
+
<dependency>
|
|
65
|
+
<groupId>com.google.code.findbugs</groupId>
|
|
66
|
+
<artifactId>jsr305</artifactId>
|
|
67
|
+
<version>3.0.2</version>
|
|
68
|
+
</dependency>
|
|
69
|
+
<dependency>
|
|
70
|
+
<groupId>com.google.code.gson</groupId>
|
|
71
|
+
<artifactId>gson</artifactId>
|
|
72
|
+
<!-- apex jorje actually depends on 2.7 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
73
|
+
</dependency>
|
|
74
|
+
<dependency>
|
|
75
|
+
<groupId>com.google.errorprone</groupId>
|
|
76
|
+
<artifactId>error_prone_annotations</artifactId>
|
|
77
|
+
<version>2.1.3</version>
|
|
78
|
+
</dependency>
|
|
79
|
+
<dependency>
|
|
80
|
+
<groupId>com.google.guava</groupId>
|
|
81
|
+
<artifactId>guava</artifactId>
|
|
82
|
+
<!-- apex jorje actually depends on 26.0-jre (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
83
|
+
</dependency>
|
|
84
|
+
<dependency>
|
|
85
|
+
<groupId>com.google.j2objc</groupId>
|
|
86
|
+
<artifactId>j2objc-annotations</artifactId>
|
|
87
|
+
<version>1.1</version>
|
|
88
|
+
</dependency>
|
|
89
|
+
<dependency>
|
|
90
|
+
<groupId>org.antlr</groupId>
|
|
91
|
+
<artifactId>antlr-runtime</artifactId>
|
|
92
|
+
</dependency>
|
|
93
|
+
<dependency>
|
|
94
|
+
<groupId>org.antlr</groupId>
|
|
95
|
+
<artifactId>stringtemplate</artifactId>
|
|
96
|
+
<version>3.2.1</version>
|
|
97
|
+
</dependency>
|
|
98
|
+
<dependency>
|
|
99
|
+
<groupId>org.apache.commons</groupId>
|
|
100
|
+
<artifactId>commons-lang3</artifactId>
|
|
101
|
+
<version>3.0</version>
|
|
102
|
+
</dependency>
|
|
103
|
+
<dependency>
|
|
104
|
+
<groupId>org.codehaus.mojo</groupId>
|
|
105
|
+
<artifactId>animal-sniffer-annotations</artifactId>
|
|
106
|
+
<version>1.14</version>
|
|
107
|
+
</dependency>
|
|
108
|
+
<dependency>
|
|
109
|
+
<groupId>org.openjdk.jol</groupId>
|
|
110
|
+
<artifactId>jol-core</artifactId>
|
|
111
|
+
<version>0.4</version>
|
|
112
|
+
</dependency>
|
|
113
|
+
<dependency>
|
|
114
|
+
<groupId>org.slf4j</groupId>
|
|
115
|
+
<artifactId>slf4j-api</artifactId>
|
|
116
|
+
<!-- apex jorje actually depends on 1.7.20 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
117
|
+
</dependency>
|
|
118
|
+
<dependency>
|
|
119
|
+
<groupId>org.yaml</groupId>
|
|
120
|
+
<artifactId>snakeyaml</artifactId>
|
|
121
|
+
<!-- apex jorje actually depends on 1.17 (https://github.com/forcedotcom/salesforcedx-vscode/commit/631b8cfb85cff5e989bfea13bca681b6cedcb003) -->
|
|
122
|
+
</dependency>
|
|
123
|
+
<dependency>
|
|
124
|
+
<groupId>aopalliance</groupId>
|
|
125
|
+
<artifactId>aopalliance</artifactId>
|
|
126
|
+
<version>1.0</version>
|
|
127
|
+
</dependency>
|
|
128
|
+
<dependency>
|
|
129
|
+
<groupId>javax.inject</groupId>
|
|
130
|
+
<artifactId>javax.inject</artifactId>
|
|
131
|
+
<version>1</version>
|
|
132
|
+
</dependency>
|
|
133
|
+
<dependency>
|
|
134
|
+
<groupId>org.ow2.asm</groupId>
|
|
135
|
+
<artifactId>asm</artifactId>
|
|
136
|
+
<version>5.0.3</version>
|
|
137
|
+
<scope>runtime</scope>
|
|
138
|
+
</dependency>
|
|
139
|
+
</dependencies>
|
|
140
|
+
</project>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/update.sh
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
2
|
+
rm -rf ${DIR}/pmd/lib/*
|
|
3
|
+
VERSION=$(curl -s https://api.github.com/repos/pmd/pmd/releases/latest | jq --raw-output ".tag_name")
|
|
4
|
+
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/pmd/pmd/releases/latest | jq --raw-output ".assets[].browser_download_url" | grep pmd-bin)
|
|
5
|
+
echo "version=${VERSION}"
|
|
6
|
+
echo "url=${DOWNLOAD_URL}"
|
|
7
|
+
curl $DOWNLOAD_URL -L -o ${DIR}/pmd.zip
|
|
8
|
+
mkdir -p ${DIR}/pmd
|
|
9
|
+
bsdtar --strip-components=1 -xvf ${DIR}/pmd.zip -C ${DIR}/pmd
|
|
10
|
+
rm ${DIR}/pmd.zip
|
|
11
|
+
cd ./pmd/lib
|
|
12
|
+
rm -rf fast*
|
|
13
|
+
rm -rf groovy*
|
|
14
|
+
rm -rf lenses*
|
|
15
|
+
rm -rf parsers*
|
|
16
|
+
rm -rf protobuf*
|
|
17
|
+
rm -rf scala*
|
|
18
|
+
rm -rf sourcecode*
|
|
19
|
+
rm -rf trees*
|
|
20
|
+
rm -rf jsoup*
|
|
21
|
+
rm -rf pmd-cpp*
|
|
22
|
+
rm -rf pmd-cs*
|
|
23
|
+
rm -rf pmd-dart*
|
|
24
|
+
rm -rf pmd-fortran*
|
|
25
|
+
rm -rf pmd-go*
|
|
26
|
+
rm -rf pmd-groovy*
|
|
27
|
+
rm -rf pmd-jsp*
|
|
28
|
+
rm -rf pmd-kotlin*
|
|
29
|
+
rm -rf pmd-lua*
|
|
30
|
+
rm -rf pmd-matlab*
|
|
31
|
+
rm -rf pmd-modelica*
|
|
32
|
+
rm -rf pmd-objectivec*
|
|
33
|
+
rm -rf pmd-perl*
|
|
34
|
+
rm -rf pmd-php*
|
|
35
|
+
rm -rf pmd-plsql*
|
|
36
|
+
rm -rf pmd-python*
|
|
37
|
+
rm -rf pmd-ruby*
|
|
38
|
+
rm -rf pmd-scala*
|
|
39
|
+
rm -rf pmd-swift*
|
|
40
|
+
rm -rf pmd-ui*
|
|
41
|
+
rm -rf pmd-html*
|
|
42
|
+
rm -rf pmd-java*
|
|
43
|
+
rm -rf pmd-javascript*
|
|
44
|
+
rm -rf pmd-visualforce*
|
|
45
|
+
rm -rf pmd-xml*
|
|
46
|
+
rm -rf pmd-vm*
|
|
47
|
+
cd ../..
|
|
48
|
+
rm -rf ${DIR}/pmd/bin
|
|
49
|
+
rm -rf ${DIR}/pmd/LICENSE
|
|
@@ -9,6 +9,8 @@ export default class Lint extends SfdxCommand {
|
|
|
9
9
|
sourcefolder: flags.Discriminated<flags.String>;
|
|
10
10
|
minapi: flags.Discriminated<flags.Number>;
|
|
11
11
|
json: flags.Discriminated<flags.Boolean<boolean>>;
|
|
12
|
+
pmd: flags.Discriminated<flags.Boolean<boolean>>;
|
|
13
|
+
rulesetpath: flags.Discriminated<flags.String>;
|
|
12
14
|
};
|
|
13
15
|
run(): Promise<any>;
|
|
14
16
|
/**
|
|
@@ -9,6 +9,7 @@ const core_1 = require("@salesforce/core");
|
|
|
9
9
|
const apex_class_lint_1 = tslib_1.__importDefault(require("../../shared/lint/apex-class-lint"));
|
|
10
10
|
const ignored_files_1 = tslib_1.__importDefault(require("../../shared/lint/ignored-files"));
|
|
11
11
|
const metadata_lint_1 = tslib_1.__importDefault(require("../../shared/lint/metadata-lint"));
|
|
12
|
+
const apex_pmd_1 = tslib_1.__importDefault(require("../../shared/lint/apex-pmd"));
|
|
12
13
|
class Lint extends command_1.SfdxCommand {
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
15
|
async run() {
|
|
@@ -16,8 +17,12 @@ class Lint extends command_1.SfdxCommand {
|
|
|
16
17
|
let violations = [];
|
|
17
18
|
await ignored_files_1.default.init(this.flags.sourcefolder);
|
|
18
19
|
violations = await new apex_class_lint_1.default().scan(this.flags.sourcefolder);
|
|
19
|
-
|
|
20
|
+
let mViolations = await new metadata_lint_1.default().scan(this.flags.sourcefolder, this.flags.minapi);
|
|
20
21
|
violations.push(...mViolations);
|
|
22
|
+
if (this.flags.pmd) {
|
|
23
|
+
mViolations = await new apex_pmd_1.default().scan(this.flags.sourcefolder, this.flags.rulesetpath);
|
|
24
|
+
violations.push(...mViolations);
|
|
25
|
+
}
|
|
21
26
|
this.printViolations(this.flags.json, violations);
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
@@ -54,6 +59,14 @@ Lint.flagsConfig = {
|
|
|
54
59
|
json: command_1.flags.boolean({
|
|
55
60
|
char: 'j',
|
|
56
61
|
description: 'generate json output'
|
|
62
|
+
}),
|
|
63
|
+
pmd: command_1.flags.boolean({
|
|
64
|
+
char: 'p',
|
|
65
|
+
description: 'generate pmd output'
|
|
66
|
+
}),
|
|
67
|
+
rulesetpath: command_1.flags.filepath({
|
|
68
|
+
char: 'r',
|
|
69
|
+
description: 'path to pmd ruleset'
|
|
57
70
|
})
|
|
58
71
|
};
|
|
59
72
|
//# sourceMappingURL=lint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../../src/commands/tffa/lint.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,iDAAyD;AACzD,2CAA+C;AAC/C,gGAA8D;AAC9D,4FAA2D;AAC3D,4FAA2D;
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../../src/commands/tffa/lint.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,iDAAyD;AACzD,2CAA+C;AAC/C,gGAA8D;AAC9D,4FAA2D;AAC3D,4FAA2D;AAC3D,kFAAiD;AAEjD,MAAqB,IAAK,SAAQ,qBAAW;IA6B3C,8DAA8D;IACvD,KAAK,CAAC,GAAG;QACd,MAAM,kBAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACnD,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,MAAM,uBAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEjD,UAAU,GAAG,MAAM,IAAI,yBAAa,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACrE,IAAI,WAAW,GAAG,MAAM,IAAI,uBAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5F,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAClB,WAAW,GAAG,MAAM,IAAI,kBAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACxF,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;SACjC;QAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI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AAE,GAAG;QACT,WAAW,EAAE,qBAAqB;KACnC,CAAC;CACH,CAAC"}
|
|
@@ -125,7 +125,7 @@ class ApexClassScan {
|
|
|
125
125
|
this.logger.debug(this.ignoreFiles);
|
|
126
126
|
await Promise.all([
|
|
127
127
|
this.checkFileNameConvention(),
|
|
128
|
-
this.checkClassesForKeywords('System\\.debug', 'Use tffa.Logger instead'),
|
|
128
|
+
// this.checkClassesForKeywords('System\\.debug', 'Use tffa.Logger instead'),
|
|
129
129
|
this.checkClassesForKeywords('\\.isCreateable', 'CRUD/FLS Checks are checked by tffa.AbstractRepository'),
|
|
130
130
|
this.checkClassesForKeywords('\\.isAccessible', 'CRUD/FLS Checks are checked by tffa.AbstractRepository'),
|
|
131
131
|
this.checkClassesForKeywords('\\.isUpdateable', 'CRUD/FLS Checks are checked by tffa.AbstractRepository'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apex-class-lint.js","sourceRoot":"","sources":["../../../src/shared/lint/apex-class-lint.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,2CAA0C;AAC1C,2BAAsE;AACtE,wDAAwB;AACxB,4EAA2C;AAE3C,MAAqB,aAAa;IAAlC;QACE,WAAM,GAAG,IAAI,CAAC;QACd,QAAG,GAAG,EAAE,CAAC;QAET,mBAAc,GAAG;YACf,YAAY;YACZ,KAAK;YACL,SAAS;YACT,UAAU;YACV,QAAQ;YACR,UAAU;YACV,SAAS;YACT,YAAY;YACZ,WAAW;YACX,KAAK;YACL,UAAU;YACV,WAAW;YACX,KAAK;YACL,QAAQ;YACR,OAAO;YACP,MAAM;YACN,UAAU;YACV,SAAS;YACT,gBAAgB;YAChB,WAAW;YACX,YAAY;YACZ,SAAS;YACT,MAAM;YACN,QAAQ;YACR,SAAS;YACT,UAAU;YACV,QAAQ;YACR,SAAS;YACT,QAAQ;YACR,YAAY;YACZ,QAAQ;YACR,SAAS;YACT,eAAe;YACf,gBAAgB;YAChB,QAAQ;YACR,QAAQ;Y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,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,uBAAY,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpC,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAI,CAAC,uBAAuB,EAAE;YAC9B,
|
|
1
|
+
{"version":3,"file":"apex-class-lint.js","sourceRoot":"","sources":["../../../src/shared/lint/apex-class-lint.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,2CAA0C;AAC1C,2BAAsE;AACtE,wDAAwB;AACxB,4EAA2C;AAE3C,MAAqB,aAAa;IAAlC;QACE,WAAM,GAAG,IAAI,CAAC;QACd,QAAG,GAAG,EAAE,CAAC;QAET,mBAAc,GAAG;YACf,YAAY;YACZ,KAAK;YACL,SAAS;YACT,UAAU;YACV,QAAQ;YACR,UAAU;YACV,SAAS;YACT,YAAY;YACZ,WAAW;YACX,KAAK;YACL,UAAU;YACV,WAAW;YACX,KAAK;YACL,QAAQ;YACR,OAAO;YACP,MAAM;YACN,UAAU;YACV,SAAS;YACT,gBAAgB;YAChB,WAAW;YACX,YAAY;YACZ,SAAS;YACT,MAAM;YACN,QAAQ;YACR,SAAS;YACT,UAAU;YACV,QAAQ;YACR,SAAS;YACT,QAAQ;YACR,YAAY;YACZ,QAAQ;YACR,SAAS;YACT,eAAe;YACf,gBAAgB;YAChB,QAAQ;YACR,QAAQ;YACR,WAAW;YACX,KAAK;YACL,QAAQ;YACR,QAAQ;YACR,SAAS;YACT,WAAW;YACX,WAAW;YACX,UAAU;YACV,UAAU;YACV,QAAQ;YACR,OAAO;YACP,UAAU;YACV,YAAY;YACZ,WAAW;YACX,aAAa;YACb,QAAQ;YACR,SAAS;YACT,OAAO;YACP,WAAW;YACX,WAAW;YACX,SAAS;YACT,YAAY;YACZ,YAAY;SACb,CAAC;Q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,QAAQ,EAAE,GAAG,CAAC,CAAC;gBAC5D,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;aACnC;iBAAM;gBACL,IAAI,cAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE;oBAC9B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACtB;aACF;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA3SD,gCA2SC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) NCR Terafina
|
|
6
|
+
**/
|
|
7
|
+
const ChildProcess = tslib_1.__importStar(require("child_process"));
|
|
8
|
+
const path = tslib_1.__importStar(require("path"));
|
|
9
|
+
const os = tslib_1.__importStar(require("os"));
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const JreSetupManager = tslib_1.__importStar(require("../utils/jreSetupManager"));
|
|
12
|
+
const ignored_files_1 = tslib_1.__importDefault(require("./ignored-files"));
|
|
13
|
+
//setup OS constants
|
|
14
|
+
const CLASSPATH_DELM = os.platform() === 'win32' ? ';' : ':';
|
|
15
|
+
class ApexPMD {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.ignoreFiles = [];
|
|
18
|
+
}
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
async scan(sourceFolder, rulesetpath) {
|
|
21
|
+
this.logger = await core_1.Logger.root();
|
|
22
|
+
this.ignoreFiles.push(...ignored_files_1.default.files);
|
|
23
|
+
this.logger.debug(this.ignoreFiles);
|
|
24
|
+
const dir = sourceFolder + '/app/';
|
|
25
|
+
try {
|
|
26
|
+
const data = await this.executeCmd(dir, rulesetpath);
|
|
27
|
+
const violations = this.parseProblems(data);
|
|
28
|
+
return violations;
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
console.error(err);
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async executeCmd(targetPath, rulesetpath) {
|
|
36
|
+
const cacheKey = '--no-cache';
|
|
37
|
+
const formatKey = `-f json`;
|
|
38
|
+
const targetPathKey = `-d "${targetPath}"`;
|
|
39
|
+
const javaHome = await JreSetupManager.verifyJreSetup();
|
|
40
|
+
const javaExc = path.join(javaHome, 'bin', 'java');
|
|
41
|
+
const commandBufferSize = 64;
|
|
42
|
+
const pmdBinPath = path.join(__dirname, '../../../', 'bin', 'pmd');
|
|
43
|
+
let rulesetsArg = path.join(pmdBinPath, 'apex_ruleset.xml') + ',' + path.join(pmdBinPath, 'apex_test_ruleset.xml');
|
|
44
|
+
if (rulesetpath) {
|
|
45
|
+
rulesetsArg = rulesetpath;
|
|
46
|
+
}
|
|
47
|
+
const rulesetsKey = `-R "${rulesetsArg}"`;
|
|
48
|
+
const classPath = [path.join(pmdBinPath, 'lib', '*')].join(CLASSPATH_DELM);
|
|
49
|
+
const pmdKeys = `${formatKey} ${cacheKey} ${targetPathKey} ${rulesetsKey}`;
|
|
50
|
+
const cmd = `"${javaExc}" -cp "${classPath}" net.sourceforge.pmd.PMD ${pmdKeys}`;
|
|
51
|
+
this.logger.info('PMD Command: ' + cmd);
|
|
52
|
+
const pmdCmd = ChildProcess.exec(cmd, {
|
|
53
|
+
maxBuffer: Math.max(commandBufferSize, 1) * 1024 * 1024
|
|
54
|
+
});
|
|
55
|
+
let stdout = '';
|
|
56
|
+
let stderr = '';
|
|
57
|
+
const pmdPromise = new Promise((resolve, reject) => {
|
|
58
|
+
pmdCmd.addListener('error', e => {
|
|
59
|
+
this.logger.error('error:' + e);
|
|
60
|
+
reject(e);
|
|
61
|
+
});
|
|
62
|
+
pmdCmd.addListener('exit', e => {
|
|
63
|
+
if (e !== 0 && e !== 4) {
|
|
64
|
+
this.logger.error(`Failed Exit Code: ${e}` + stderr);
|
|
65
|
+
reject(stderr);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
resolve(stdout);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
pmdCmd.stdout.on('data', (m) => {
|
|
72
|
+
this.logger.info('stdout:' + m);
|
|
73
|
+
stdout += m;
|
|
74
|
+
});
|
|
75
|
+
pmdCmd.stderr.on('data', (m) => {
|
|
76
|
+
this.logger.error('stderr:' + m);
|
|
77
|
+
stderr += m;
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
return pmdPromise;
|
|
81
|
+
}
|
|
82
|
+
parseProblems(json) {
|
|
83
|
+
let violations = [];
|
|
84
|
+
this.logger.debug(json);
|
|
85
|
+
if (!json) {
|
|
86
|
+
return violations;
|
|
87
|
+
}
|
|
88
|
+
// ApexCRUDViolation test EmptyCatchBlock
|
|
89
|
+
const p = JSON.parse(json);
|
|
90
|
+
if (!p.files) {
|
|
91
|
+
return violations;
|
|
92
|
+
}
|
|
93
|
+
const violationMap = new Map();
|
|
94
|
+
for (const f of p.files) {
|
|
95
|
+
for (const v of f.violations) {
|
|
96
|
+
const file = f.filename;
|
|
97
|
+
const filename = path.basename(file, '.cls');
|
|
98
|
+
if (this.ignoreFiles.indexOf(filename) >= 0 || this.ignoreFiles.indexOf(file) >= 0) {
|
|
99
|
+
this.logger.warn('Ignore file ' + filename);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const key = v.ruleset + '-' + v.rule;
|
|
103
|
+
let o = violationMap.get(key);
|
|
104
|
+
if (!o) {
|
|
105
|
+
o = {
|
|
106
|
+
label: v.ruleset + '-' + v.rule + ' (' + v.externalInfoUrl + ')',
|
|
107
|
+
message: v.description,
|
|
108
|
+
category: 'PMD',
|
|
109
|
+
level: v.priority < 3 ? 'FATAL' : 'WARN',
|
|
110
|
+
exceptions: [filename + '#' + v.beginline]
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
o.exceptions = [filename + '#' + v.beginline, ...o.exceptions];
|
|
115
|
+
}
|
|
116
|
+
violationMap.set(key, o);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
violations = Array.from(violationMap.values());
|
|
120
|
+
return violations;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.default = ApexPMD;
|
|
124
|
+
//# sourceMappingURL=apex-pmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apex-pmd.js","sourceRoot":"","sources":["../../../src/shared/lint/apex-pmd.ts"],"names":[],"mappings":";;;AAAA;;IAEI;AACJ,oEAA8C;AAC9C,mDAA6B;AAC7B,+CAAyB;AACzB,2CAA0C;AAC1C,kFAA4D;AAC5D,4EAA2C;AAE3C,oBAAoB;AACpB,MAAM,cAAc,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAE7D,MAAqB,OAAO;IAA5B;QACE,gBAAW,GAAG,EAAE,CAAC;IAiHnB,CAAC;IA9GC,8DAA8D;IACvD,KAAK,CAAC,IAAI,CAAC,YAAoB,EAAE,WAAmB;QACzD,IAAI,CAAC,MAAM,GAAG,MAAM,aAAM,CAAC,IAAI,EAAE,CAAC;QAElC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,uBAAY,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEpC,MAAM,GAAG,GAAG,YAAY,GAAG,OAAO,CAAC;QACnC,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;YACrD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC5C,OAAO,UAAU,CAAC;SACnB;QAAC,OAAO,GAAG,EA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AAO,EAAE,CAAC,CAAC,WAAW;wBACtB,QAAQ,EAAE,KAAK;wBACf,KAAK,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;wBACxC,UAAU,EAAE,CAAC,QAAQ,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS,CAAC;qBAC3C,CAAC;iBACH;qBAAM;oBACL,CAAC,CAAC,UAAU,GAAG,CAAC,QAAQ,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;iBAChE;gBACD,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aAC1B;SACF;QACD,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;QAE/C,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAlHD,0BAkHC"}
|
|
@@ -10,17 +10,28 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
10
10
|
class IgnoredFiles {
|
|
11
11
|
static async init(sourceFolder) {
|
|
12
12
|
this.logger = await core_1.Logger.root();
|
|
13
|
+
const currentWorkingFolder = process.cwd();
|
|
13
14
|
const fileContent = (0, fs_1.readFileSync)(sourceFolder + '/.forceignore');
|
|
14
15
|
const lfiles = fileContent
|
|
15
16
|
.toString()
|
|
16
17
|
.split(/\r?\n/)
|
|
17
18
|
.filter(l => l.trim() !== '' && l.charAt(0) !== '#');
|
|
18
19
|
for (const f of lfiles) {
|
|
19
|
-
|
|
20
|
+
let filepath = '';
|
|
21
|
+
if (sourceFolder && sourceFolder != '.') {
|
|
22
|
+
filepath = path_1.default.join(sourceFolder, f);
|
|
23
|
+
this.files.push(filepath);
|
|
24
|
+
}
|
|
25
|
+
if (currentWorkingFolder != sourceFolder) {
|
|
26
|
+
filepath = path_1.default.join(currentWorkingFolder, f);
|
|
27
|
+
this.files.push(filepath);
|
|
28
|
+
}
|
|
20
29
|
this.files.push(f);
|
|
21
|
-
this.files.push(filepath);
|
|
22
30
|
}
|
|
23
31
|
}
|
|
32
|
+
getCurrentWorkingDirectory() {
|
|
33
|
+
return process.cwd();
|
|
34
|
+
}
|
|
24
35
|
}
|
|
25
36
|
exports.default = IgnoredFiles;
|
|
26
37
|
IgnoredFiles.files = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignored-files.js","sourceRoot":"","sources":["../../../src/shared/lint/ignored-files.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,2CAA0C;AAC1C,2BAAkC;AAClC,wDAAwB;AAExB,MAAqB,YAAY;IAGxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAoB;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,aAAM,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,IAAA,iBAAY,EAAC,YAAY,GAAG,eAAe,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,WAAW;aACvB,QAAQ,EAAE;aACV,KAAK,CAAC,OAAO,CAAC;aACd,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QACvD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;YACtB,
|
|
1
|
+
{"version":3,"file":"ignored-files.js","sourceRoot":"","sources":["../../../src/shared/lint/ignored-files.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,2CAA0C;AAC1C,2BAAkC;AAClC,wDAAwB;AAExB,MAAqB,YAAY;IAGxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAoB;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,aAAM,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3C,MAAM,WAAW,GAAG,IAAA,iBAAY,EAAC,YAAY,GAAG,eAAe,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,WAAW;aACvB,QAAQ,EAAE;aACV,KAAK,CAAC,OAAO,CAAC;aACd,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QACvD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;YACtB,IAAI,QAAQ,GAAG,EAAE,CAAC;YAClB,IAAI,YAAY,IAAI,YAAY,IAAI,GAAG,EAAE;gBACvC,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC3B;YACD,IAAI,oBAAoB,IAAI,YAAY,EAAE;gBACxC,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC;gBAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC3B;YAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpB;IACH,CAAC;IACD,0BAA0B;QACxB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;IACvB,CAAC;;AA3BH,+BA4BC;AA3Be,kBAAK,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AsyncCreatable } from '@salesforce/kit';
|
|
2
|
+
export declare class JreSetupManagerDependencies {
|
|
3
|
+
autoDetectJavaHome(): Promise<string>;
|
|
4
|
+
}
|
|
5
|
+
export declare class JreSetupManager extends AsyncCreatable {
|
|
6
|
+
private logger;
|
|
7
|
+
private dependencies;
|
|
8
|
+
private initialized;
|
|
9
|
+
protected init(): Promise<void>;
|
|
10
|
+
verifyJreSetup(): Promise<string>;
|
|
11
|
+
private findJavaHome;
|
|
12
|
+
private findJavaHomeFromSysVariables;
|
|
13
|
+
private autoDetectJavaHome;
|
|
14
|
+
private verifyJavaVersion;
|
|
15
|
+
private fetchJavaVersion;
|
|
16
|
+
}
|
|
17
|
+
export declare function verifyJreSetup(): Promise<string>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyJreSetup = exports.JreSetupManager = exports.JreSetupManagerDependencies = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) NCR Terafina
|
|
6
|
+
**/
|
|
7
|
+
const core_1 = require("@salesforce/core");
|
|
8
|
+
const kit_1 = require("@salesforce/kit");
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const process = require("process");
|
|
11
|
+
const findJavaHome = require("find-java-home");
|
|
12
|
+
const childProcess = require("child_process");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
// Initialize Messages with the current plugin directory
|
|
15
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
|
+
const JAVA_HOME_SYSTEM_VARIABLES = ['JAVA_HOME', 'JRE_HOME', 'JDK_HOME'];
|
|
17
|
+
// Exported only to be used by tests
|
|
18
|
+
class JreSetupManagerDependencies {
|
|
19
|
+
autoDetectJavaHome() {
|
|
20
|
+
return new Promise(resolve => {
|
|
21
|
+
findJavaHome({ allowJre: true }, (err, home) => {
|
|
22
|
+
resolve(err ? null : home);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.JreSetupManagerDependencies = JreSetupManagerDependencies;
|
|
28
|
+
class JreSetupManager extends kit_1.AsyncCreatable {
|
|
29
|
+
async init() {
|
|
30
|
+
if (this.initialized) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.logger = await core_1.Logger.child('verifyJRE');
|
|
34
|
+
this.dependencies = new JreSetupManagerDependencies();
|
|
35
|
+
this.initialized = true;
|
|
36
|
+
}
|
|
37
|
+
async verifyJreSetup() {
|
|
38
|
+
// Find Java Home
|
|
39
|
+
const javaHome = await this.findJavaHome();
|
|
40
|
+
// If we have javaHome, verify that it is a valid path
|
|
41
|
+
fs.statSync(javaHome);
|
|
42
|
+
// If path exists, verify Java version
|
|
43
|
+
await this.verifyJavaVersion(javaHome);
|
|
44
|
+
return javaHome;
|
|
45
|
+
}
|
|
46
|
+
async findJavaHome() {
|
|
47
|
+
let javaHome;
|
|
48
|
+
// First try getting javaHome from config
|
|
49
|
+
// If config doesn't have javaHome, try getting from System Variables
|
|
50
|
+
javaHome = this.findJavaHomeFromSysVariables();
|
|
51
|
+
// If System Variables don't have javaHome, try to detect automatically from javac
|
|
52
|
+
if (!javaHome) {
|
|
53
|
+
javaHome = await this.autoDetectJavaHome();
|
|
54
|
+
}
|
|
55
|
+
// If we reach this point and we somehow still haven't found a javaHome, then we're pretty thoroughly hosed.
|
|
56
|
+
// So we'll just throw an error telling the user to set it themselves.
|
|
57
|
+
if (!javaHome) {
|
|
58
|
+
throw core_1.SfdxError.create('@terafina/tffa-sfdx-plugin', 'jreSetupManager', 'NoJavaHomeFound', []);
|
|
59
|
+
}
|
|
60
|
+
return javaHome;
|
|
61
|
+
}
|
|
62
|
+
findJavaHomeFromSysVariables() {
|
|
63
|
+
let javaHome = null;
|
|
64
|
+
const env = process.env;
|
|
65
|
+
for (const sysVariable of JAVA_HOME_SYSTEM_VARIABLES) {
|
|
66
|
+
javaHome = env[sysVariable];
|
|
67
|
+
if (javaHome) {
|
|
68
|
+
this.logger.trace(`Found javaHome from ${sysVariable} as ${javaHome}`);
|
|
69
|
+
return javaHome;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return javaHome;
|
|
73
|
+
}
|
|
74
|
+
autoDetectJavaHome() {
|
|
75
|
+
return this.dependencies.autoDetectJavaHome();
|
|
76
|
+
}
|
|
77
|
+
async verifyJavaVersion(javaHome) {
|
|
78
|
+
const versionOut = await this.fetchJavaVersion(javaHome);
|
|
79
|
+
// Version output looks like this:
|
|
80
|
+
// MacOS: "openjdk version "11.0.6" 2020-01-14 LTS\nOpenJDK Runtime Environment Zulu11.37+17-CA (build 11.0.6+10-LTS)\nOpenJDK 64-Bit Server VM Zulu11.37+17-CA (build 11.0.6+10-LTS, mixed mode)\n"
|
|
81
|
+
// Win10: "openjdk 14 2020-03-17\r\nOpenJDK Runtime Environment (build 14+36-1461)\r\nOpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)\r\n"
|
|
82
|
+
// We want to get the "11.0" or "14" part
|
|
83
|
+
// The version number could be of the format 11.0 or 1.8 or 14
|
|
84
|
+
const regex = /(\d+)(\.(\d+))?/;
|
|
85
|
+
const matchedParts = regex.exec(versionOut);
|
|
86
|
+
this.logger.trace(`Version output match for pattern ${regex} is ${matchedParts}`);
|
|
87
|
+
// matchedParts should have four groups: "11.0", "11", ".0", "0" or "14", "14", undefined, undefined
|
|
88
|
+
if (!matchedParts || matchedParts.length < 4) {
|
|
89
|
+
throw core_1.SfdxError.create('@terafina/tffa-sfdx-plugin', 'jreSetupManager', 'VersionNotFound', []);
|
|
90
|
+
}
|
|
91
|
+
const majorVersion = parseInt(matchedParts[1]);
|
|
92
|
+
const minorVersion = matchedParts[3] ? parseInt(matchedParts[3]) : '';
|
|
93
|
+
let version = '';
|
|
94
|
+
// We want to allow 1.8 and greater.
|
|
95
|
+
// Upto JDK8, the version scheme is 1.blah
|
|
96
|
+
// Starting JDK 9, the version scheme is 9.blah for 9, 10.blah for 10, etc.
|
|
97
|
+
// If either version part clicks, we should be good.
|
|
98
|
+
if (majorVersion >= 9) {
|
|
99
|
+
// Accept if Major version is greater than or equal to 9
|
|
100
|
+
version += majorVersion + (minorVersion ? `.${minorVersion}` : '');
|
|
101
|
+
}
|
|
102
|
+
else if (majorVersion === 1 && minorVersion === 8) {
|
|
103
|
+
// Accommodating 1.8
|
|
104
|
+
version += majorVersion + '.' + minorVersion;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// Not matching what we are looking for
|
|
108
|
+
throw core_1.SfdxError.create('@terafina/tffa-sfdx-plugin', 'jreSetupManager', 'InvalidVersion', [version]);
|
|
109
|
+
}
|
|
110
|
+
this.logger.trace(`Java version found as ${version}`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
async fetchJavaVersion(javaHome) {
|
|
114
|
+
const javaWithFullPath = path.join(javaHome, 'bin', 'java');
|
|
115
|
+
// Run java -version and examine stderr for version
|
|
116
|
+
return new Promise((resolve, reject) => {
|
|
117
|
+
childProcess.execFile(javaWithFullPath, ['-version'], {}, (error, _stdout, stderr) => {
|
|
118
|
+
if (error) {
|
|
119
|
+
return reject(`Could not fetch Java version from path ${javaHome}. Reason: ${error.message}`);
|
|
120
|
+
}
|
|
121
|
+
// TODO: Mac always returns this value in stderr. Check if the behavior is the same for other OS types
|
|
122
|
+
this.logger.trace(`Java version received as ${stderr}`);
|
|
123
|
+
return resolve(stderr);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.JreSetupManager = JreSetupManager;
|
|
129
|
+
// Method that'll be invoked externally
|
|
130
|
+
async function verifyJreSetup() {
|
|
131
|
+
const manager = await JreSetupManager.create({});
|
|
132
|
+
return await manager.verifyJreSetup();
|
|
133
|
+
}
|
|
134
|
+
exports.verifyJreSetup = verifyJreSetup;
|
|
135
|
+
//# sourceMappingURL=jreSetupManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jreSetupManager.js","sourceRoot":"","sources":["../../../src/shared/utils/jreSetupManager.ts"],"names":[],"mappings":";;;AAAA;;IAEI;AACJ,2CAA+D;AAC/D,yCAAiD;AACjD,yBAA0B;AAC1B,mCAAoC;AACpC,+CAAgD;AAChD,8CAA+C;AAC/C,6BAA8B;AAE9B,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CA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EAAE;gBACnF,IAAI,KAAK,EAAE;oBACT,OAAO,MAAM,CAAC,0CAA0C,QAAQ,aAAa,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;iBAC/F;gBACD,sGAAsG;gBACtG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,MAAM,EAAE,CAAC,CAAC;gBACxD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvHD,0CAuHC;AAED,uCAAuC;AAChC,KAAK,UAAU,cAAc;IAClC,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjD,OAAO,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;AACxC,CAAC;AAHD,wCAGC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"14.0.0-rc.1","commands":{"tffa:apexdoc":{"id":"tffa:apexdoc","description":"Generate Apex API Documentation","strict":true,"usage":"<%= command.id %> [-d <directory>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@terafina/tffa-sfdx-plugin","pluginAlias":"@terafina/tffa-sfdx-plugin","pluginType":"core","aliases":[],"examples":["Generate Apex API Documentation :\t$sfdx tffa:apexdoc "],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","multiple":false,"options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"sourcefolder":{"name":"sourcefolder","type":"option","char":"d","description":"directory containing package metadata","multiple":false,"default":"."}},"args":[],"flagsConfig":{"sourcefolder":{"kind":"directory","char":"d","description":"directory containing package metadata","default":".","input":[],"multiple":false,"type":"option"}}},"tffa:lint":{"id":"tffa:lint","description":"scan a sfdx project and provide a violations report based on defined standards","strict":true,"usage":"<%= command.id %> [-s <directory>] [-m <integer>] [-p] [-r <filepath>] [-j] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@terafina/tffa-sfdx-plugin","pluginAlias":"@terafina/tffa-sfdx-plugin","pluginType":"core","aliases":[],"examples":["Scan a sfdx project and provide list of code violations :\t$sfdx tffa:scan"],"flags":{"json":{"name":"json","type":"boolean","char":"j","description":"generate json output","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","multiple":false,"options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"sourcefolder":{"name":"sourcefolder","type":"option","char":"s","description":"directory containing sfdx project","multiple":false,"default":"."},"minapi":{"name":"minapi","type":"option","char":"m","description":"minimum api version to use during quality checks","multiple":false,"default":53},"pmd":{"name":"pmd","type":"boolean","char":"p","description":"generate pmd output","allowNo":false},"rulesetpath":{"name":"rulesetpath","type":"option","char":"r","description":"path to pmd ruleset","multiple":false}},"args":[],"flagsConfig":{"sourcefolder":{"kind":"directory","char":"s","description":"directory containing sfdx project","default":".","input":[],"multiple":false,"type":"option"},"minapi":{"kind":"integer","char":"m","description":"minimum api version to use during quality checks","default":53,"input":[],"multiple":false,"type":"option"},"json":{"kind":"boolean","char":"j","description":"generate json output","allowNo":false,"type":"boolean"},"pmd":{"kind":"boolean","char":"p","description":"generate pmd output","allowNo":false,"type":"boolean"},"rulesetpath":{"kind":"filepath","char":"r","description":"path to pmd ruleset","input":[],"multiple":false,"type":"option"}}},"tffa:meta":{"id":"tffa:meta","description":"scan a sfdx project for metadata","strict":true,"usage":"<%= command.id %> [-s <directory>] [-d <directory>] [-c <directory>] [-o json|csv|human] [-f] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@terafina/tffa-sfdx-plugin","pluginAlias":"@terafina/tffa-sfdx-plugin","pluginType":"core","aliases":[],"examples":["scan a sfdx project for metadata :\t$sfdx tffa:meta"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","multiple":false,"options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"sourcefolder":{"name":"sourcefolder","type":"option","char":"s","description":"directory containing sfdx project","multiple":false,"default":"."},"destpath":{"name":"destpath","type":"option","char":"d","description":"full path output file","multiple":false,"default":"."},"clientname":{"name":"clientname","type":"option","char":"c","description":"name of the client","multiple":false,"default":"."},"output":{"name":"output","type":"option","char":"o","description":"output format json csv human","helpValue":"(json|csv|human)","multiple":false,"options":["json","csv","human"]},"fields":{"name":"fields","type":"boolean","char":"f","description":"generate field output","allowNo":false}},"args":[],"flagsConfig":{"sourcefolder":{"kind":"directory","char":"s","description":"directory containing sfdx project","default":".","input":[],"multiple":false,"type":"option"},"destpath":{"kind":"directory","char":"d","description":"full path output file","default":".","input":[],"multiple":false,"type":"option"},"clientname":{"kind":"directory","char":"c","description":"name of the client","default":".","input":[],"multiple":false,"type":"option"},"output":{"kind":"enum","helpValue":"(json|csv|human)","char":"o","options":["json","csv","human"],"description":"output format json csv human","input":[],"multiple":false,"type":"option"},"fields":{"kind":"boolean","char":"f","description":"generate field output","allowNo":false,"type":"boolean"}}},"tffa:ping":{"id":"tffa:ping","description":"ping","strict":true,"usage":"<%= command.id %> [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@terafina/tffa-sfdx-plugin","pluginAlias":"@terafina/tffa-sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx tffa:ping "],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","multiple":false,"options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"}},"args":[{"name":"file"}],"flagsConfig":{}}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terafina/tffa-sfdx-plugin",
|
|
3
3
|
"description": "sfdx plugin from Terafina containing tools for scanning and extending digital applications for the financial services industry.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.0-rc.1",
|
|
5
5
|
"author": "Terafina Inc",
|
|
6
6
|
"bugs": "https://github.com/terafinainc/tffa-sfdx-plugin/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"@oclif/plugin-warn-if-update-available": "2.0.4",
|
|
13
13
|
"@salesforce/command": "5.2.1",
|
|
14
14
|
"@salesforce/core": "2.37.1",
|
|
15
|
+
"find-java-home": "1.2.2",
|
|
15
16
|
"cheerio": "1.0.0-rc.12",
|
|
16
17
|
"csv-stringify": "6.1.3",
|
|
17
18
|
"fs-extra": "10.1.0",
|
|
@@ -108,14 +109,15 @@
|
|
|
108
109
|
"prepack": "rimraf lib && tsc -b && oclif manifest && oclif readme",
|
|
109
110
|
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
110
111
|
"version": "oclif readme && git add README.md",
|
|
111
|
-
"publish": "git push --follow-tags origin
|
|
112
|
-
"publish_rc": "git push --follow-tags origin
|
|
112
|
+
"publish": "git push --follow-tags origin develop && npm run package && npm publish terafina-tffa-sfdx-plugin-$npm_package_version.tgz && npm dist-tag add @terafina/tffa-sfdx-plugin@$npm_package_version r$npm_config_tffa_version",
|
|
113
|
+
"publish_rc": "git push --follow-tags origin develop && npm run package && npm publish --tag next terafina-tffa-sfdx-plugin-$npm_package_version.tgz && npm dist-tag add @terafina/tffa-sfdx-plugin@$npm_package_version r$npm_config_tffa_version",
|
|
113
114
|
"package": "npm pack ",
|
|
114
115
|
"release": "standard-version --commit-all",
|
|
115
116
|
"release_rc": "npm run release -- --prerelease rc",
|
|
116
117
|
"release_patch": "npm run release -- --release-as patch",
|
|
117
118
|
"release_minor": "npm run release -- --release-as minor",
|
|
118
119
|
"release_major": "npm run release -- --release-as major",
|
|
120
|
+
"release_major_rc": "npm run release -- --release-as major --prerelease rc",
|
|
119
121
|
"update-dependencies": "ncu -u && git add . && git commit -m 'chore(deps): update dependencies'",
|
|
120
122
|
"yaml-2-grammar": "node ./scripts/grammar/convertGrammar.js",
|
|
121
123
|
"prepare": "husky install"
|
package/bin/run
DELETED
package/bin/run.cmd
DELETED