Skip to content

Commit 21b5554

Browse files
authored
(Chore): Fix linter download issues (#1091)
1. pmd: Add new snapshot 2. squawk: add new snapshot 3. psscriptanalyzer: use stable dependency package 4. nancy: hitting a [401 issue](sonatype-nexus-community/nancy#284), not sure what our next step should be for that, but not tackling that here
1 parent e176f4e commit 21b5554

File tree

3 files changed

+287
-1
lines changed

3 files changed

+287
-1
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Testing linter pmd test CUSTOM 1`] = `
4+
{
5+
"issues": [
6+
{
7+
"code": "ApexDoc",
8+
"column": "8",
9+
"file": "test_data/apex.in.cls",
10+
"issueClass": "ISSUE_CLASS_EXISTING",
11+
"level": "LEVEL_MEDIUM",
12+
"line": "1",
13+
"linter": "pmd",
14+
"message": "Missing ApexDoc comment",
15+
"ranges": [
16+
{
17+
"filePath": "test_data/apex.in.cls",
18+
"length": "69",
19+
"offset": "7",
20+
},
21+
],
22+
"targetType": "apex",
23+
},
24+
{
25+
"code": "AvoidGlobalModifier",
26+
"column": "8",
27+
"file": "test_data/apex.in.cls",
28+
"issueClass": "ISSUE_CLASS_EXISTING",
29+
"level": "LEVEL_MEDIUM",
30+
"line": "1",
31+
"linter": "pmd",
32+
"message": "Avoid using global modifier",
33+
"ranges": [
34+
{
35+
"filePath": "test_data/apex.in.cls",
36+
"length": "69",
37+
"offset": "7",
38+
},
39+
],
40+
"targetType": "apex",
41+
},
42+
{
43+
"code": "ApexDoc",
44+
"column": "8",
45+
"file": "test_data/apex.in.cls",
46+
"issueClass": "ISSUE_CLASS_EXISTING",
47+
"level": "LEVEL_MEDIUM",
48+
"line": "2",
49+
"linter": "pmd",
50+
"message": "Missing ApexDoc comment",
51+
"ranges": [
52+
{
53+
"filePath": "test_data/apex.in.cls",
54+
"length": "41",
55+
"offset": "33",
56+
},
57+
],
58+
"targetType": "apex",
59+
},
60+
{
61+
"code": "NoPackage",
62+
"column": "1",
63+
"file": "test_data/hello.in.java",
64+
"issueClass": "ISSUE_CLASS_EXISTING",
65+
"level": "LEVEL_MEDIUM",
66+
"line": "3",
67+
"linter": "pmd",
68+
"message": "All classes, interfaces, enums and annotations must belong to a named package",
69+
"ranges": [
70+
{
71+
"filePath": "test_data/hello.in.java",
72+
"length": "5",
73+
"offset": "23",
74+
},
75+
],
76+
"targetType": "java",
77+
},
78+
{
79+
"code": "UseUtilityClass",
80+
"column": "1",
81+
"file": "test_data/hello.in.java",
82+
"issueClass": "ISSUE_CLASS_EXISTING",
83+
"level": "LEVEL_MEDIUM",
84+
"line": "3",
85+
"linter": "pmd",
86+
"message": "All methods are static. Consider adding a private no-args constructor to prevent instantiation.",
87+
"ranges": [
88+
{
89+
"filePath": "test_data/hello.in.java",
90+
"length": "5",
91+
"offset": "23",
92+
},
93+
],
94+
"targetType": "java",
95+
},
96+
],
97+
"lintActions": [
98+
{
99+
"command": "lint-apex",
100+
"fileGroupName": "apex",
101+
"linter": "pmd",
102+
"paths": [
103+
"test_data/apex.in.cls",
104+
],
105+
"verb": "TRUNK_VERB_CHECK",
106+
},
107+
{
108+
"command": "lint-apex",
109+
"fileGroupName": "apex",
110+
"linter": "pmd",
111+
"paths": [
112+
"test_data/apex.in.cls",
113+
],
114+
"upstream": true,
115+
"verb": "TRUNK_VERB_CHECK",
116+
},
117+
{
118+
"command": "lint-java",
119+
"fileGroupName": "java",
120+
"linter": "pmd",
121+
"paths": [
122+
"test_data/hello.in.java",
123+
],
124+
"verb": "TRUNK_VERB_CHECK",
125+
},
126+
{
127+
"command": "lint-java",
128+
"fileGroupName": "java",
129+
"linter": "pmd",
130+
"paths": [
131+
"test_data/hello.in.java",
132+
],
133+
"upstream": true,
134+
"verb": "TRUNK_VERB_CHECK",
135+
},
136+
],
137+
"taskFailures": [],
138+
"unformattedFiles": [],
139+
}
140+
`;

linters/psscriptanalyzer/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ downloads:
2525
linux: linux
2626
windows: windows
2727
macos: macos
28-
url: https://psg-prod-eastus.azureedge.net/packages/converttosarif.${version}.nupkg
28+
url: https://www.powershellgallery.com/api/v2/package/ConvertToSARIF/${version}
2929
tools:
3030
definitions:
3131
- name: psscriptanalyzer
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Testing linter squawk test basic 1`] = `
4+
{
5+
"issues": [
6+
{
7+
"code": "prefer-robust-stmts",
8+
"file": "test_data/basic.in.sql",
9+
"issueClass": "ISSUE_CLASS_EXISTING",
10+
"level": "LEVEL_HIGH",
11+
"linter": "squawk",
12+
"message": "Missing \`IF NOT EXISTS\`, the migration can't be rerun if it fails part way through.",
13+
"targetType": "sql",
14+
},
15+
{
16+
"code": "prefer-bigint-over-int",
17+
"column": "7",
18+
"file": "test_data/basic.in.sql",
19+
"issueClass": "ISSUE_CLASS_EXISTING",
20+
"level": "LEVEL_HIGH",
21+
"line": "1",
22+
"linter": "squawk",
23+
"message": "Using 32-bit integer fields can result in hitting the max \`int\` limit.",
24+
"targetType": "sql",
25+
},
26+
{
27+
"code": "prefer-identity",
28+
"column": "7",
29+
"file": "test_data/basic.in.sql",
30+
"issueClass": "ISSUE_CLASS_EXISTING",
31+
"level": "LEVEL_HIGH",
32+
"line": "1",
33+
"linter": "squawk",
34+
"message": "Serial types make schema, dependency, and permission management difficult.",
35+
"targetType": "sql",
36+
},
37+
{
38+
"code": "prefer-text-field",
39+
"column": "10",
40+
"file": "test_data/basic.in.sql",
41+
"issueClass": "ISSUE_CLASS_EXISTING",
42+
"level": "LEVEL_HIGH",
43+
"line": "2",
44+
"linter": "squawk",
45+
"message": "Changing the size of a \`varchar\` field requires an \`ACCESS EXCLUSIVE\` lock, that will prevent all reads and writes to the table.",
46+
"targetType": "sql",
47+
},
48+
{
49+
"code": "prefer-robust-stmts",
50+
"file": "test_data/basic.in.sql",
51+
"issueClass": "ISSUE_CLASS_EXISTING",
52+
"level": "LEVEL_HIGH",
53+
"line": "5",
54+
"linter": "squawk",
55+
"message": "Missing \`IF NOT EXISTS\`, the migration can't be rerun if it fails part way through.",
56+
"targetType": "sql",
57+
},
58+
{
59+
"code": "require-concurrent-index-creation",
60+
"file": "test_data/basic.in.sql",
61+
"issueClass": "ISSUE_CLASS_EXISTING",
62+
"level": "LEVEL_HIGH",
63+
"line": "5",
64+
"linter": "squawk",
65+
"message": "During normal index creation, table updates are blocked, but reads are still allowed.",
66+
"targetType": "sql",
67+
},
68+
{
69+
"code": "require-timeout-settings",
70+
"file": "test_data/basic.in.sql",
71+
"issueClass": "ISSUE_CLASS_EXISTING",
72+
"level": "LEVEL_HIGH",
73+
"line": "5",
74+
"linter": "squawk",
75+
"message": "Missing \`set lock_timeout\` before potentially slow operations",
76+
"targetType": "sql",
77+
},
78+
{
79+
"code": "require-timeout-settings",
80+
"file": "test_data/basic.in.sql",
81+
"issueClass": "ISSUE_CLASS_EXISTING",
82+
"level": "LEVEL_HIGH",
83+
"line": "5",
84+
"linter": "squawk",
85+
"message": "Missing \`set statement_timeout\` before potentially slow operations",
86+
"targetType": "sql",
87+
},
88+
{
89+
"code": "constraint-missing-not-valid",
90+
"column": "23",
91+
"file": "test_data/basic.in.sql",
92+
"issueClass": "ISSUE_CLASS_EXISTING",
93+
"level": "LEVEL_HIGH",
94+
"line": "7",
95+
"linter": "squawk",
96+
"message": "By default new constraints require a table scan and block writes to the table while that scan occurs.",
97+
"targetType": "sql",
98+
},
99+
{
100+
"code": "prefer-robust-stmts",
101+
"column": "23",
102+
"file": "test_data/basic.in.sql",
103+
"issueClass": "ISSUE_CLASS_EXISTING",
104+
"level": "LEVEL_HIGH",
105+
"line": "7",
106+
"linter": "squawk",
107+
"message": "Missing transaction, the migration can't be rerun if it fails part way through.",
108+
"targetType": "sql",
109+
},
110+
{
111+
"code": "disallowed-unique-constraint",
112+
"column": "27",
113+
"file": "test_data/basic.in.sql",
114+
"issueClass": "ISSUE_CLASS_EXISTING",
115+
"level": "LEVEL_HIGH",
116+
"line": "7",
117+
"linter": "squawk",
118+
"message": "Adding a \`UNIQUE\` constraint requires an \`ACCESS EXCLUSIVE\` lock which blocks reads and writes to the table while the index is built.",
119+
"targetType": "sql",
120+
},
121+
],
122+
"lintActions": [
123+
{
124+
"command": "lint",
125+
"fileGroupName": "sql",
126+
"linter": "squawk",
127+
"paths": [
128+
"test_data/basic.in.sql",
129+
],
130+
"verb": "TRUNK_VERB_CHECK",
131+
},
132+
{
133+
"command": "lint",
134+
"fileGroupName": "sql",
135+
"linter": "squawk",
136+
"paths": [
137+
"test_data/basic.in.sql",
138+
],
139+
"upstream": true,
140+
"verb": "TRUNK_VERB_CHECK",
141+
},
142+
],
143+
"taskFailures": [],
144+
"unformattedFiles": [],
145+
}
146+
`;

0 commit comments

Comments
 (0)