-
Notifications
You must be signed in to change notification settings - Fork 2
/
sasjslint-schema.json
327 lines (327 loc) · 11.7 KB
/
sasjslint-schema.json
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/sasjs/lint/blob/main/sasjslint-schema.json",
"type": "object",
"title": "SASjs Lint Config File",
"description": "The SASjs Lint Config file provides the settings for customising SAS code style in your project.",
"default": {
"noEncodedPasswords": true,
"hasDoxygenHeader": true,
"defaultHeader": "/**{lineEnding} @file{lineEnding} @brief <Your brief here>{lineEnding} <h4> SAS Macros </h4>{lineEnding}**/",
"hasMacroNameInMend": false,
"hasMacroParentheses": true,
"indentationMultiple": 2,
"lowerCaseFileNames": true,
"maxLineLength": 80,
"maxHeaderLineLength": 80,
"maxDataLineLength": 80,
"noGremlins": true,
"noNestedMacros": true,
"noSpacesInFileNames": true,
"noTabs": true,
"noTrailingSpaces": true,
"lineEndings": "off",
"strictMacroDefinition": true,
"ignoreList": ["sajsbuild", "sasjsresults"]
},
"examples": [
{
"noTrailingSpaces": true,
"noEncodedPasswords": true,
"hasDoxygenHeader": true,
"noSpacesInFileNames": true,
"lowerCaseFileNames": true,
"maxLineLength": 80,
"maxHeaderLineLength": 80,
"maxDataLineLength": 80,
"noGremlins": true,
"allowedGremlins": ["0x0080", "0x3000"],
"noTabs": true,
"indentationMultiple": 4,
"hasMacroNameInMend": true,
"noNestedMacros": true,
"hasMacroParentheses": true,
"lineEndings": "crlf",
"strictMacroDefinition": true,
"ignoreList": ["sajsbuild", "sasjsresults"]
}
],
"properties": {
"noEncodedPasswords": {
"$id": "#/properties/noEncodedPasswords",
"type": "boolean",
"title": "noEncodedPasswords",
"description": "Enforces no encoded passwords such as {SAS001} or {SASENC} in lines of SAS code. Shows an error when they are present.",
"default": true,
"examples": [true, false]
},
"hasDoxygenHeader": {
"$id": "#/properties/hasDoxygenHeader",
"type": "boolean",
"title": "hasDoxygenHeader",
"description": "Enforces the presence of a Doxygen header in the form of a comment block at the start of each SAS file. Shows a warning when one is absent.",
"default": true,
"examples": [true, false]
},
"defaultHeader": {
"$id": "#/properties/defaultHeader",
"type": "string",
"title": "defaultHeader",
"description": "This sets the default program header - applies when a SAS program does NOT begin with `/**`.",
"default": "/**{lineEnding} @file{lineEnding} @brief <Your brief here>{lineEnding} <h4> SAS Macros </h4>{lineEnding}**/",
"examples": []
},
"noGremlins": {
"$id": "#/properties/noGremlins",
"type": "boolean",
"title": "noGremlins",
"description": "Captures problematic characters such as zero-width whitespace and others that look valid but usually are not (such as the en dash)",
"default": [true],
"examples": [true, false]
},
"allowedGremlins": {
"$id": "#/properties/allowedGremlins",
"type": "array",
"items": {
"type": "string",
"pattern": "^0x[0-9A-Fa-f]{4}$"
},
"title": "allowedGremlins",
"description": "An array of hex codes that represents allowed gremlins.",
"default": [],
"examples": ["0x0080", "0x3000"]
},
"hasMacroNameInMend": {
"$id": "#/properties/hasMacroNameInMend",
"type": "boolean",
"title": "hasMacroNameInMend",
"description": "Enforces the presence of macro names in %mend statements. Shows a warning for %mend statements with missing or mismatched macro names.",
"default": false,
"examples": [true, false]
},
"hasMacroParentheses": {
"$id": "#/properties/hasMacroParentheses",
"type": "boolean",
"title": "hasMacroParentheses",
"description": "Enforces the presence of parentheses in macro definitions. Shows a warning for each macro defined without parentheses, or with spaces between the macro name and the opening parenthesis.",
"default": true,
"examples": [true, false]
},
"indentationMultiple": {
"$id": "#/properties/indentationMultiple",
"type": "number",
"title": "indentationMultiple",
"description": "Enforces a configurable multiple for the number of spaces for indentation. Shows a warning for lines that are not indented by a multiple of this number.",
"default": 2,
"examples": [2, 3, 4]
},
"lowerCaseFileNames": {
"$id": "#/properties/lowerCaseFileNames",
"type": "boolean",
"title": "lowerCaseFileNames",
"description": "Enforces no uppercase characters in file names. Shows a warning when they are present.",
"default": true,
"examples": [true, false]
},
"maxLineLength": {
"$id": "#/properties/maxLineLength",
"type": "number",
"title": "maxLineLength",
"description": "Enforces a configurable maximum line length. Shows a warning for lines exceeding this length.",
"default": 80,
"examples": [60, 80, 120]
},
"maxHeaderLineLength": {
"$id": "#/properties/maxHeaderLineLength",
"type": "number",
"title": "maxHeaderLineLength",
"description": "Enforces a configurable maximum line length for header section. Shows a warning for lines exceeding this length.",
"default": 80,
"examples": [60, 80, 120]
},
"maxDataLineLength": {
"$id": "#/properties/maxDataLineLength",
"type": "number",
"title": "maxDataLineLength",
"description": "Enforces a configurable maximum line length for data section. Shows a warning for lines exceeding this length.",
"default": 80,
"examples": [60, 80, 120]
},
"noNestedMacros": {
"$id": "#/properties/noNestedMacros",
"type": "boolean",
"title": "noNestedMacros",
"description": "Enforces the absence of nested macro definitions. Shows a warning for each nested macro definition.",
"default": true,
"examples": [true, false]
},
"noSpacesInFileNames": {
"$id": "#/properties/noSpacesInFileNames",
"type": "boolean",
"title": "noSpacesInFileNames",
"description": "Enforces no spaces in file names. Shows a warning when they are present.",
"default": true,
"examples": [true, false]
},
"noTabs": {
"$id": "#/properties/noTabs",
"type": "boolean",
"title": "noTabs",
"description": "Enforces no indentation using tabs. Shows a warning when a line contains a tab.",
"default": true,
"examples": [true, false]
},
"noTrailingSpaces": {
"$id": "#/properties/noTrailingSpaces",
"type": "boolean",
"title": "noTrailingSpaces",
"description": "Enforces no trailing spaces in lines of SAS code. Shows a warning when they are present.",
"default": true,
"examples": [true, false]
},
"lineEndings": {
"$id": "#/properties/lineEndings",
"type": "string",
"enum": ["lf", "crlf", "off"],
"title": "lineEndings",
"description": "Enforces the configured terminating character for each line. Shows a warning when incorrect line endings are present.",
"default": "off",
"examples": ["lf", "crlf"]
},
"strictMacroDefinition": {
"$id": "#/properties/strictMacroDefinition",
"type": "boolean",
"title": "strictMacroDefinition",
"description": "Enforces Macro Definition syntax. Shows a warning when incorrect syntax is used.",
"default": true,
"examples": [true, false]
},
"ignoreList": {
"$id": "#/properties/ignoreList",
"type": "array",
"title": "ignoreList",
"description": "An array of paths or path patterns to ignore when linting. Any files or matching patterns in the .gitignore file will also be ignored.",
"default": ["sasjsbuild/", "sasjsresults/"],
"examples": ["sasjs/tests", "tmp/scratch.sas"]
},
"severityLevel": {
"$id": "#/properties/severityLevel",
"type": "object",
"title": "severityLevel",
"description": "An object which specifies the severity level of each rule.",
"default": {},
"examples": [
{
"hasDoxygenHeader": "warn",
"maxLineLength": "warn",
"noTrailingSpaces": "error"
},
{
"hasDoxygenHeader": "warn",
"maxLineLength": "error",
"noTrailingSpaces": "error"
}
],
"properties": {
"noEncodedPasswords": {
"$id": "#/properties/severityLevel/noEncodedPasswords",
"title": "noEncodedPasswords",
"type": "string",
"enum": ["error", "warn"],
"default": "error"
},
"hasDoxygenHeader": {
"$id": "#/properties/severityLevel/hasDoxygenHeader",
"title": "hasDoxygenHeader",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"noGremlins": {
"$id": "#/properties/severityLevel/noGremlins",
"title": "noGremlins",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"hasMacroNameInMend": {
"$id": "#/properties/severityLevel/hasMacroNameInMend",
"title": "hasMacroNameInMend",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"hasMacroParentheses": {
"$id": "#/properties/severityLevel/hasMacroParentheses",
"title": "hasMacroParentheses",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"indentationMultiple": {
"$id": "#/properties/severityLevel/indentationMultiple",
"title": "indentationMultiple",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"lowerCaseFileNames": {
"$id": "#/properties/severityLevel/lowerCaseFileNames",
"title": "lowerCaseFileNames",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"maxLineLength": {
"$id": "#/properties/severityLevel/maxLineLength",
"title": "maxLineLength",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"noNestedMacros": {
"$id": "#/properties/severityLevel/noNestedMacros",
"title": "noNestedMacros",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"noSpacesInFileNames": {
"$id": "#/properties/severityLevel/noSpacesInFileNames",
"title": "noSpacesInFileNames",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"noTabs": {
"$id": "#/properties/severityLevel/noTabs",
"title": "noTabs",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"noTrailingSpaces": {
"$id": "#/properties/severityLevel/noTrailingSpaces",
"title": "noTrailingSpaces",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"lineEndings": {
"$id": "#/properties/severityLevel/lineEndings",
"title": "lineEndings",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
},
"strictMacroDefinition": {
"$id": "#/properties/severityLevel/strictMacroDefinition",
"title": "strictMacroDefinition",
"type": "string",
"enum": ["error", "warn"],
"default": "warn"
}
}
}
}
}