@codacy/tools-shellcheck-0 0.1.0

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/dist/index.js ADDED
@@ -0,0 +1,4281 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ default: () => index_default
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+ var import_tooling2 = require("@codacy/tooling");
37
+
38
+ // src/adapter.ts
39
+ var import_tooling = require("@codacy/tooling");
40
+ var import_path = __toESM(require("path"));
41
+ var import_promises = __toESM(require("fs/promises"));
42
+
43
+ // src/patterns.json
44
+ var patterns_default = [
45
+ {
46
+ id: "shellcheck_SC1000",
47
+ category: "BestPractice",
48
+ severityLevel: "Info",
49
+ title: "Escape Literal Dollar Sign in Shell Scripts",
50
+ enabled: false,
51
+ parameters: []
52
+ },
53
+ {
54
+ id: "shellcheck_SC1001",
55
+ category: "ErrorProne",
56
+ severityLevel: "Warning",
57
+ title: "Avoid Escaping Characters Without Special Meaning",
58
+ enabled: false,
59
+ parameters: []
60
+ },
61
+ {
62
+ id: "shellcheck_SC1003",
63
+ category: "ErrorProne",
64
+ severityLevel: "High",
65
+ title: "Escape Single Quotes Correctly in Shell Scripts",
66
+ enabled: false,
67
+ parameters: []
68
+ },
69
+ {
70
+ id: "shellcheck_SC1007",
71
+ category: "ErrorProne",
72
+ severityLevel: "Warning",
73
+ title: "Remove Space After '=' When Assigning Values",
74
+ enabled: false,
75
+ parameters: []
76
+ },
77
+ {
78
+ id: "shellcheck_SC1008",
79
+ category: "ErrorProne",
80
+ severityLevel: "Warning",
81
+ title: "Recognize Shebang or Add Shell Directive",
82
+ enabled: false,
83
+ parameters: []
84
+ },
85
+ {
86
+ id: "shellcheck_SC1009",
87
+ category: "ErrorProne",
88
+ severityLevel: "High",
89
+ title: "Report Parser Error Location",
90
+ enabled: false,
91
+ parameters: []
92
+ },
93
+ {
94
+ id: "shellcheck_SC1010",
95
+ category: "ErrorProne",
96
+ severityLevel: "Warning",
97
+ title: "Use Semicolon or Linefeed Before Shell Keywords like 'done'",
98
+ enabled: false,
99
+ parameters: []
100
+ },
101
+ {
102
+ id: "shellcheck_SC1011",
103
+ category: "ErrorProne",
104
+ severityLevel: "High",
105
+ title: "Avoid Premature Termination of Single-Quoted Strings by Apostrophes",
106
+ enabled: false,
107
+ parameters: []
108
+ },
109
+ {
110
+ id: "shellcheck_SC1012",
111
+ category: "ErrorProne",
112
+ severityLevel: "Warning",
113
+ title: "Avoid Using '\\t' as Literal 't' in Shell Scripts",
114
+ enabled: false,
115
+ parameters: []
116
+ },
117
+ {
118
+ id: "shellcheck_SC1014",
119
+ category: "ErrorProne",
120
+ severityLevel: "High",
121
+ title: "Use Proper Syntax to Check Command Exit Code or Output in Shell If Statements",
122
+ enabled: false,
123
+ parameters: []
124
+ },
125
+ {
126
+ id: "shellcheck_SC1017",
127
+ category: "ErrorProne",
128
+ severityLevel: "High",
129
+ title: "Avoid Literal Carriage Return Characters in Shell Scripts",
130
+ enabled: false,
131
+ parameters: []
132
+ },
133
+ {
134
+ id: "shellcheck_SC1018",
135
+ category: "ErrorProne",
136
+ severityLevel: "High",
137
+ title: "Avoid Unicode Non-breaking Spaces",
138
+ enabled: false,
139
+ parameters: []
140
+ },
141
+ {
142
+ id: "shellcheck_SC1019",
143
+ category: "ErrorProne",
144
+ severityLevel: "High",
145
+ title: "Ensure Unary Condition Has an Argument",
146
+ enabled: false,
147
+ parameters: []
148
+ },
149
+ {
150
+ id: "shellcheck_SC1020",
151
+ category: "ErrorProne",
152
+ severityLevel: "High",
153
+ title: "Require Space Before Closing Bracket in Test Expressions",
154
+ enabled: false,
155
+ parameters: []
156
+ },
157
+ {
158
+ id: "shellcheck_SC1026",
159
+ category: "BestPractice",
160
+ severityLevel: "Warning",
161
+ title: "Use Proper Grouping Inside [[..]] Expressions",
162
+ enabled: false,
163
+ parameters: []
164
+ },
165
+ {
166
+ id: "shellcheck_SC1027",
167
+ category: "ErrorProne",
168
+ severityLevel: "High",
169
+ title: "Detect Missing Operand for Test Operator",
170
+ enabled: false,
171
+ parameters: []
172
+ },
173
+ {
174
+ id: "shellcheck_SC1028",
175
+ category: "ErrorProne",
176
+ severityLevel: "Warning",
177
+ title: "Avoid Unescaped Grouping Parentheses in [..] Test Expressions",
178
+ enabled: false,
179
+ parameters: []
180
+ },
181
+ {
182
+ id: "shellcheck_SC1029",
183
+ category: "ErrorProne",
184
+ severityLevel: "High",
185
+ title: "Avoid Escaping Parentheses in [[..]] Expressions",
186
+ enabled: false,
187
+ parameters: []
188
+ },
189
+ {
190
+ id: "shellcheck_SC1033",
191
+ category: "ErrorProne",
192
+ severityLevel: "High",
193
+ title: "Match Opening and Closing Brackets in Test Expressions",
194
+ enabled: false,
195
+ parameters: []
196
+ },
197
+ {
198
+ id: "shellcheck_SC1034",
199
+ category: "ErrorProne",
200
+ severityLevel: "High",
201
+ title: "Enforce Matching Brackets in Test Expressions",
202
+ enabled: false,
203
+ parameters: []
204
+ },
205
+ {
206
+ id: "shellcheck_SC1035",
207
+ category: "ErrorProne",
208
+ severityLevel: "High",
209
+ title: "Require Space After Negation in Conditional Expressions",
210
+ enabled: false,
211
+ parameters: []
212
+ },
213
+ {
214
+ id: "shellcheck_SC1036",
215
+ category: "ErrorProne",
216
+ severityLevel: "High",
217
+ title: "Avoid Unescaped Parentheses in Shell Commands",
218
+ enabled: false,
219
+ parameters: []
220
+ },
221
+ {
222
+ id: "shellcheck_SC1037",
223
+ category: "ErrorProne",
224
+ severityLevel: "High",
225
+ title: "Enforce Braces for Positional Parameters Over 9",
226
+ enabled: false,
227
+ parameters: []
228
+ },
229
+ {
230
+ id: "shellcheck_SC1038",
231
+ category: "ErrorProne",
232
+ severityLevel: "High",
233
+ title: "Enforce correct spacing for process substitution redirection",
234
+ enabled: false,
235
+ parameters: []
236
+ },
237
+ {
238
+ id: "shellcheck_SC1039",
239
+ category: "ErrorProne",
240
+ severityLevel: "Warning",
241
+ title: "Remove Indentation Before Here Document End Token",
242
+ enabled: false,
243
+ parameters: []
244
+ },
245
+ {
246
+ id: "shellcheck_SC1040",
247
+ category: "ErrorProne",
248
+ severityLevel: "Warning",
249
+ title: "Enforce Tab Indentation with Here-Documents Using <<-",
250
+ enabled: false,
251
+ parameters: []
252
+ },
253
+ {
254
+ id: "shellcheck_SC1041",
255
+ category: "ErrorProne",
256
+ severityLevel: "High",
257
+ title: "Enforce Here Document Terminator on Separate Line",
258
+ enabled: false,
259
+ parameters: []
260
+ },
261
+ {
262
+ id: "shellcheck_SC1043",
263
+ category: "ErrorProne",
264
+ severityLevel: "High",
265
+ title: "Enforce Matching Case in Here Document End Token",
266
+ enabled: false,
267
+ parameters: []
268
+ },
269
+ {
270
+ id: "shellcheck_SC1044",
271
+ category: "ErrorProne",
272
+ severityLevel: "High",
273
+ title: "Enforce Proper Termination of Here Document",
274
+ enabled: false,
275
+ parameters: []
276
+ },
277
+ {
278
+ id: "shellcheck_SC1045",
279
+ category: "ErrorProne",
280
+ severityLevel: "Warning",
281
+ title: "Avoid Using Both '&' and ';' Together to Separate Commands",
282
+ enabled: false,
283
+ parameters: []
284
+ },
285
+ {
286
+ id: "shellcheck_SC1046",
287
+ category: "ErrorProne",
288
+ severityLevel: "High",
289
+ title: "Ensure Matching fi for if Statement",
290
+ enabled: false,
291
+ parameters: []
292
+ },
293
+ {
294
+ id: "shellcheck_SC1047",
295
+ category: "ErrorProne",
296
+ severityLevel: "High",
297
+ title: "Ensure Matching 'fi' for 'if' Statements",
298
+ enabled: false,
299
+ parameters: []
300
+ },
301
+ {
302
+ id: "shellcheck_SC1048",
303
+ category: "ErrorProne",
304
+ severityLevel: "High",
305
+ title: "Disallow Empty Then Clauses in Shell Scripts",
306
+ enabled: false,
307
+ parameters: []
308
+ },
309
+ {
310
+ id: "shellcheck_SC1049",
311
+ category: "ErrorProne",
312
+ severityLevel: "High",
313
+ title: "Enforce presence of then in if statements",
314
+ enabled: false,
315
+ parameters: []
316
+ },
317
+ {
318
+ id: "shellcheck_SC1050",
319
+ category: "ErrorProne",
320
+ severityLevel: "High",
321
+ title: "Enforce presence of 'then' in if statements",
322
+ enabled: false,
323
+ parameters: []
324
+ },
325
+ {
326
+ id: "shellcheck_SC1051",
327
+ category: "ErrorProne",
328
+ severityLevel: "High",
329
+ title: "Disallow Semicolons Directly After 'then'",
330
+ enabled: false,
331
+ parameters: []
332
+ },
333
+ {
334
+ id: "shellcheck_SC1052",
335
+ category: "ErrorProne",
336
+ severityLevel: "High",
337
+ title: "Disallow Semicolons Directly After 'then'",
338
+ enabled: false,
339
+ parameters: []
340
+ },
341
+ {
342
+ id: "shellcheck_SC1053",
343
+ category: "ErrorProne",
344
+ severityLevel: "High",
345
+ title: "Disallow Semicolons Directly After Else",
346
+ enabled: false,
347
+ parameters: []
348
+ },
349
+ {
350
+ id: "shellcheck_SC1054",
351
+ category: "ErrorProne",
352
+ severityLevel: "High",
353
+ title: "Enforce space after opening brace in shell functions",
354
+ enabled: false,
355
+ parameters: []
356
+ },
357
+ {
358
+ id: "shellcheck_SC1055",
359
+ category: "ErrorProne",
360
+ severityLevel: "High",
361
+ title: "Avoid Empty Code Blocks",
362
+ enabled: false,
363
+ parameters: []
364
+ },
365
+ {
366
+ id: "shellcheck_SC1056",
367
+ category: "ErrorProne",
368
+ severityLevel: "High",
369
+ title: "Require Semicolon or Newline Before Closing Brace in Shell Functions",
370
+ enabled: false,
371
+ parameters: []
372
+ },
373
+ {
374
+ id: "shellcheck_SC1057",
375
+ category: "ErrorProne",
376
+ severityLevel: "High",
377
+ title: "Enforce presence of 'do' in loops",
378
+ enabled: false,
379
+ parameters: []
380
+ },
381
+ {
382
+ id: "shellcheck_SC1058",
383
+ category: "ErrorProne",
384
+ severityLevel: "High",
385
+ title: "Enforce presence of 'do' in shell loops",
386
+ enabled: false,
387
+ parameters: []
388
+ },
389
+ {
390
+ id: "shellcheck_SC1059",
391
+ category: "ErrorProne",
392
+ severityLevel: "High",
393
+ title: "Disallow Semicolon Directly After 'do'",
394
+ enabled: false,
395
+ parameters: []
396
+ },
397
+ {
398
+ id: "shellcheck_SC1060",
399
+ category: "ErrorProne",
400
+ severityLevel: "High",
401
+ title: "Avoid Empty do Clauses in Shell Scripts",
402
+ enabled: false,
403
+ parameters: []
404
+ },
405
+ {
406
+ id: "shellcheck_SC1061",
407
+ category: "ErrorProne",
408
+ severityLevel: "High",
409
+ title: "Ensure matching done for do in shell loops",
410
+ enabled: false,
411
+ parameters: []
412
+ },
413
+ {
414
+ id: "shellcheck_SC1062",
415
+ category: "ErrorProne",
416
+ severityLevel: "High",
417
+ title: "Enforce matching 'done' for each 'do' in shell scripts",
418
+ enabled: false,
419
+ parameters: []
420
+ },
421
+ {
422
+ id: "shellcheck_SC1063",
423
+ category: "ErrorProne",
424
+ severityLevel: "High",
425
+ title: "Enforce line feed or semicolon before 'do' in loops",
426
+ enabled: false,
427
+ parameters: []
428
+ },
429
+ {
430
+ id: "shellcheck_SC1064",
431
+ category: "ErrorProne",
432
+ severityLevel: "High",
433
+ title: "Enforce Function Definition with Opening Brace",
434
+ enabled: false,
435
+ parameters: []
436
+ },
437
+ {
438
+ id: "shellcheck_SC1065",
439
+ category: "ErrorProne",
440
+ severityLevel: "High",
441
+ title: "Avoid Declaring Parameters in Shell Functions; Use Positional Parameters Instead",
442
+ enabled: false,
443
+ parameters: []
444
+ },
445
+ {
446
+ id: "shellcheck_SC1066",
447
+ category: "ErrorProne",
448
+ severityLevel: "High",
449
+ title: "Avoid Using `$` on the Left Side of Assignments",
450
+ enabled: false,
451
+ parameters: []
452
+ },
453
+ {
454
+ id: "shellcheck_SC1069",
455
+ category: "ErrorProne",
456
+ severityLevel: "High",
457
+ title: "Enforce space before the '[' in shell conditionals",
458
+ enabled: false,
459
+ parameters: []
460
+ },
461
+ {
462
+ id: "shellcheck_SC1070",
463
+ category: "ErrorProne",
464
+ severityLevel: "Error",
465
+ title: "Detect Parsing Errors Due to Mismatched Keywords or Invalid Parentheses",
466
+ enabled: false,
467
+ parameters: []
468
+ },
469
+ {
470
+ id: "shellcheck_SC1071",
471
+ category: "Compatibility",
472
+ severityLevel: "Warning",
473
+ title: "Enforce Supported Shell Script Languages",
474
+ enabled: false,
475
+ parameters: []
476
+ },
477
+ {
478
+ id: "shellcheck_SC1072",
479
+ category: "ErrorProne",
480
+ severityLevel: "Warning",
481
+ title: "Avoid Unexpected '..' in ShellCheck Directives",
482
+ enabled: false,
483
+ parameters: []
484
+ },
485
+ {
486
+ id: "shellcheck_SC1073",
487
+ category: "ErrorProne",
488
+ severityLevel: "Error",
489
+ title: "Fix Parsing Errors to Allow More Checks",
490
+ enabled: false,
491
+ parameters: []
492
+ },
493
+ {
494
+ id: "shellcheck_SC1074",
495
+ category: "ErrorProne",
496
+ severityLevel: "High",
497
+ title: "Enforce double semicolon after each case item in shell case statements",
498
+ enabled: false,
499
+ parameters: []
500
+ },
501
+ {
502
+ id: "shellcheck_SC1075",
503
+ category: "ErrorProne",
504
+ severityLevel: "Warning",
505
+ title: "Use 'elif' Instead of 'else if' in Shell Scripts",
506
+ enabled: false,
507
+ parameters: []
508
+ },
509
+ {
510
+ id: "shellcheck_SC1076",
511
+ category: "ErrorProne",
512
+ severityLevel: "High",
513
+ title: "Use Arithmetic Expansion in Shell Conditionals",
514
+ enabled: false,
515
+ parameters: []
516
+ },
517
+ {
518
+ id: "shellcheck_SC1077",
519
+ category: "ErrorProne",
520
+ severityLevel: "Warning",
521
+ title: "Use Correct Backtick for Command Expansion",
522
+ enabled: false,
523
+ parameters: []
524
+ },
525
+ {
526
+ id: "shellcheck_SC1078",
527
+ category: "ErrorProne",
528
+ severityLevel: "High",
529
+ title: "Detect Unclosed Double-Quoted Strings",
530
+ enabled: false,
531
+ parameters: []
532
+ },
533
+ {
534
+ id: "shellcheck_SC1079",
535
+ category: "ErrorProne",
536
+ severityLevel: "Warning",
537
+ title: "Avoid Misinterpreting End Quotes Due to Following Characters",
538
+ enabled: false,
539
+ parameters: []
540
+ },
541
+ {
542
+ id: "shellcheck_SC1080",
543
+ category: "ErrorProne",
544
+ severityLevel: "High",
545
+ title: "Enforce Escaping Line Breaks in [ ] Test Expressions",
546
+ enabled: false,
547
+ parameters: []
548
+ },
549
+ {
550
+ id: "shellcheck_SC1081",
551
+ category: "ErrorProne",
552
+ severityLevel: "High",
553
+ title: "Use lowercase 'if' in shell scripts",
554
+ enabled: false,
555
+ parameters: []
556
+ },
557
+ {
558
+ id: "shellcheck_SC1082",
559
+ category: "ErrorProne",
560
+ severityLevel: "High",
561
+ title: "Remove UTF-8 Byte Order Mark (BOM) from Shell Scripts",
562
+ enabled: false,
563
+ parameters: []
564
+ },
565
+ {
566
+ id: "shellcheck_SC1083",
567
+ category: "ErrorProne",
568
+ severityLevel: "Warning",
569
+ title: "Check Literal Curly Braces for Missing Semicolon or Quoting",
570
+ enabled: false,
571
+ parameters: []
572
+ },
573
+ {
574
+ id: "shellcheck_SC1084",
575
+ category: "ErrorProne",
576
+ severityLevel: "High",
577
+ title: "Use correct shebang syntax",
578
+ enabled: false,
579
+ parameters: []
580
+ },
581
+ {
582
+ id: "shellcheck_SC1086",
583
+ category: "ErrorProne",
584
+ severityLevel: "Warning",
585
+ title: "Avoid Using `$` on the Iterator Name in For Loops",
586
+ enabled: false,
587
+ parameters: []
588
+ },
589
+ {
590
+ id: "shellcheck_SC1087",
591
+ category: "BestPractice",
592
+ severityLevel: "Info",
593
+ title: "Use Braces When Expanding Arrays",
594
+ enabled: false,
595
+ parameters: []
596
+ },
597
+ {
598
+ id: "shellcheck_SC1088",
599
+ category: "ErrorProne",
600
+ severityLevel: "High",
601
+ title: "Avoid Invalid Use of Parentheses in Shell Scripts",
602
+ enabled: false,
603
+ parameters: []
604
+ },
605
+ {
606
+ id: "shellcheck_SC1089",
607
+ category: "ErrorProne",
608
+ severityLevel: "High",
609
+ title: "Detect Incorrect Shell Keyword Matching",
610
+ enabled: false,
611
+ parameters: []
612
+ },
613
+ {
614
+ id: "shellcheck_SC1090",
615
+ category: "ErrorProne",
616
+ severityLevel: "Warning",
617
+ title: "Enforce Use of Directives for Non-Constant Source Paths",
618
+ enabled: false,
619
+ parameters: []
620
+ },
621
+ {
622
+ id: "shellcheck_SC1091",
623
+ category: "ErrorProne",
624
+ severityLevel: "Warning",
625
+ title: "Avoid Unresolvable Source Files",
626
+ enabled: false,
627
+ parameters: []
628
+ },
629
+ {
630
+ id: "shellcheck_SC1092",
631
+ category: "ErrorProne",
632
+ severityLevel: "High",
633
+ title: "Avoid Excessive Recursive Sourcing of Files",
634
+ enabled: false,
635
+ parameters: []
636
+ },
637
+ {
638
+ id: "shellcheck_SC1094",
639
+ category: "ErrorProne",
640
+ severityLevel: "Warning",
641
+ title: "Avoid Parsing Errors in Sourced Files",
642
+ enabled: false,
643
+ parameters: []
644
+ },
645
+ {
646
+ id: "shellcheck_SC1095",
647
+ category: "ErrorProne",
648
+ severityLevel: "Warning",
649
+ title: "Enforce Space Between Function Name and Body in Shell Scripts",
650
+ enabled: false,
651
+ parameters: []
652
+ },
653
+ {
654
+ id: "shellcheck_SC1097",
655
+ category: "ErrorProne",
656
+ severityLevel: "High",
657
+ title: "Avoid Unexpected Use of `==` in Shell Scripts",
658
+ enabled: false,
659
+ parameters: []
660
+ },
661
+ {
662
+ id: "shellcheck_SC1098",
663
+ category: "ErrorProne",
664
+ severityLevel: "High",
665
+ title: "Quote or Escape Special Characters When Using eval",
666
+ enabled: false,
667
+ parameters: []
668
+ },
669
+ {
670
+ id: "shellcheck_SC1099",
671
+ category: "CodeStyle",
672
+ severityLevel: "Info",
673
+ title: "Enforce space before comment marker `#`",
674
+ enabled: false,
675
+ parameters: []
676
+ },
677
+ {
678
+ id: "shellcheck_SC1100",
679
+ category: "ErrorProne",
680
+ severityLevel: "High",
681
+ title: "Avoid Unicode Dashes; Use ASCII Minus",
682
+ enabled: false,
683
+ parameters: []
684
+ },
685
+ {
686
+ id: "shellcheck_SC1101",
687
+ category: "ErrorProne",
688
+ severityLevel: "Warning",
689
+ title: "Delete trailing spaces after backslash to break line",
690
+ enabled: false,
691
+ parameters: []
692
+ },
693
+ {
694
+ id: "shellcheck_SC1102",
695
+ category: "ErrorProne",
696
+ severityLevel: "High",
697
+ title: "Disambiguate $(( Arithmetic and Command Substitution in Shell Scripts",
698
+ enabled: false,
699
+ parameters: []
700
+ },
701
+ {
702
+ id: "shellcheck_SC1103",
703
+ category: "Compatibility",
704
+ severityLevel: "Warning",
705
+ title: "Avoid Using Unknown Shell Types",
706
+ enabled: false,
707
+ parameters: []
708
+ },
709
+ {
710
+ id: "shellcheck_SC1104",
711
+ category: "ErrorProne",
712
+ severityLevel: "High",
713
+ title: "Enforce correct shebang syntax with #!",
714
+ enabled: false,
715
+ parameters: []
716
+ },
717
+ {
718
+ id: "shellcheck_SC1105",
719
+ category: "ErrorProne",
720
+ severityLevel: "Warning",
721
+ title: "Disambiguate Subshell with Space After Opening Parenthesis",
722
+ enabled: false,
723
+ parameters: []
724
+ },
725
+ {
726
+ id: "shellcheck_SC1106",
727
+ category: "ErrorProne",
728
+ severityLevel: "Warning",
729
+ title: "Use Arithmetic Comparison Operators Instead of Test Command Flags in Arithmetic Contexts",
730
+ enabled: false,
731
+ parameters: []
732
+ },
733
+ {
734
+ id: "shellcheck_SC1107",
735
+ category: "ErrorProne",
736
+ severityLevel: "Warning",
737
+ title: "Avoid Unknown ShellCheck Directives",
738
+ enabled: false,
739
+ parameters: []
740
+ },
741
+ {
742
+ id: "shellcheck_SC1108",
743
+ category: "ErrorProne",
744
+ severityLevel: "High",
745
+ title: "Enforce Spaces Around '=' Operator in Test Expressions",
746
+ enabled: false,
747
+ parameters: []
748
+ },
749
+ {
750
+ id: "shellcheck_SC1109",
751
+ category: "ErrorProne",
752
+ severityLevel: "High",
753
+ title: "Avoid Unquoted HTML Entities",
754
+ enabled: false,
755
+ parameters: []
756
+ },
757
+ {
758
+ id: "shellcheck_SC1110",
759
+ category: "ErrorProne",
760
+ severityLevel: "High",
761
+ title: "Avoid Unicode Quotes in Shell Scripts",
762
+ enabled: false,
763
+ parameters: []
764
+ },
765
+ {
766
+ id: "shellcheck_SC1111",
767
+ category: "ErrorProne",
768
+ severityLevel: "High",
769
+ title: "Avoid Unicode Quotes in Shell Scripts",
770
+ enabled: false,
771
+ parameters: []
772
+ },
773
+ {
774
+ id: "shellcheck_SC1112",
775
+ category: "ErrorProne",
776
+ severityLevel: "High",
777
+ title: "Avoid Unicode Quotes in Shell Scripts",
778
+ enabled: false,
779
+ parameters: []
780
+ },
781
+ {
782
+ id: "shellcheck_SC1113",
783
+ category: "ErrorProne",
784
+ severityLevel: "High",
785
+ title: "Enforce Proper Shebang Syntax",
786
+ enabled: false,
787
+ parameters: []
788
+ },
789
+ {
790
+ id: "shellcheck_SC1114",
791
+ category: "ErrorProne",
792
+ severityLevel: "High",
793
+ title: "Remove Leading Spaces Before Shebang",
794
+ enabled: false,
795
+ parameters: []
796
+ },
797
+ {
798
+ id: "shellcheck_SC1115",
799
+ category: "ErrorProne",
800
+ severityLevel: "High",
801
+ title: "Remove spaces between # and ! in the shebang",
802
+ enabled: false,
803
+ parameters: []
804
+ },
805
+ {
806
+ id: "shellcheck_SC1116",
807
+ category: "ErrorProne",
808
+ severityLevel: "High",
809
+ title: "Enforce Correct Use of Arithmetic Expressions with $((..))",
810
+ enabled: false,
811
+ parameters: []
812
+ },
813
+ {
814
+ id: "shellcheck_SC1117",
815
+ category: "CodeStyle",
816
+ severityLevel: "Info",
817
+ title: "Prefer Explicit Escaping of Backslash in Double-Quoted Strings",
818
+ enabled: false,
819
+ parameters: []
820
+ },
821
+ {
822
+ id: "shellcheck_SC1118",
823
+ category: "ErrorProne",
824
+ severityLevel: "High",
825
+ title: "Delete whitespace after the here-doc end token",
826
+ enabled: false,
827
+ parameters: []
828
+ },
829
+ {
830
+ id: "shellcheck_SC1119",
831
+ category: "ErrorProne",
832
+ severityLevel: "High",
833
+ title: "Enforce Linefeed Between Here Document End Token and Closing Parenthesis",
834
+ enabled: false,
835
+ parameters: []
836
+ },
837
+ {
838
+ id: "shellcheck_SC1120",
839
+ category: "ErrorProne",
840
+ severityLevel: "Warning",
841
+ title: "Disallow Comments After Here-Doc Terminator",
842
+ enabled: false,
843
+ parameters: []
844
+ },
845
+ {
846
+ id: "shellcheck_SC1121",
847
+ category: "ErrorProne",
848
+ severityLevel: "High",
849
+ title: "Add Terminators on the Line with Here Document",
850
+ enabled: false,
851
+ parameters: []
852
+ },
853
+ {
854
+ id: "shellcheck_SC1122",
855
+ category: "ErrorProne",
856
+ severityLevel: "High",
857
+ title: "Disallow Text After Here-Document End Token",
858
+ enabled: false,
859
+ parameters: []
860
+ },
861
+ {
862
+ id: "shellcheck_SC1123",
863
+ category: "ErrorProne",
864
+ severityLevel: "Warning",
865
+ title: "Enforce Correct Placement of ShellCheck Directives Before Complete Compound Commands",
866
+ enabled: false,
867
+ parameters: []
868
+ },
869
+ {
870
+ id: "shellcheck_SC1124",
871
+ category: "BestPractice",
872
+ severityLevel: "Info",
873
+ title: "Enforce Valid Placement of ShellCheck Directives in Case Statements",
874
+ enabled: false,
875
+ parameters: []
876
+ },
877
+ {
878
+ id: "shellcheck_SC1125",
879
+ category: "ErrorProne",
880
+ severityLevel: "Warning",
881
+ title: "Avoid Invalid key=value Pair in ShellCheck Directive",
882
+ enabled: false,
883
+ parameters: []
884
+ },
885
+ {
886
+ id: "shellcheck_SC1126",
887
+ category: "CodeStyle",
888
+ severityLevel: "Info",
889
+ title: "Place ShellCheck Directives Before Commands",
890
+ enabled: false,
891
+ parameters: []
892
+ },
893
+ {
894
+ id: "shellcheck_SC1127",
895
+ category: "ErrorProne",
896
+ severityLevel: "High",
897
+ title: "Use Hash for Comments in Shell Scripts",
898
+ enabled: false,
899
+ parameters: []
900
+ },
901
+ {
902
+ id: "shellcheck_SC1128",
903
+ category: "ErrorProne",
904
+ severityLevel: "High",
905
+ title: "Enforce Shebang on First Line",
906
+ enabled: false,
907
+ parameters: []
908
+ },
909
+ {
910
+ id: "shellcheck_SC1129",
911
+ category: "ErrorProne",
912
+ severityLevel: "Warning",
913
+ title: "Enforce space before the '!' operator",
914
+ enabled: false,
915
+ parameters: []
916
+ },
917
+ {
918
+ id: "shellcheck_SC1130",
919
+ category: "ErrorProne",
920
+ severityLevel: "Warning",
921
+ title: "Require Space Before Colon in Shell Keywords",
922
+ enabled: false,
923
+ parameters: []
924
+ },
925
+ {
926
+ id: "shellcheck_SC1131",
927
+ category: "ErrorProne",
928
+ severityLevel: "High",
929
+ title: "Use `elif` to Start Another Branch",
930
+ enabled: false,
931
+ parameters: []
932
+ },
933
+ {
934
+ id: "shellcheck_SC1132",
935
+ category: "ErrorProne",
936
+ severityLevel: "High",
937
+ title: "Escape or Separate Ampersand to Avoid Command Termination",
938
+ enabled: false,
939
+ parameters: []
940
+ },
941
+ {
942
+ id: "shellcheck_SC1133",
943
+ category: "ErrorProne",
944
+ severityLevel: "Warning",
945
+ title: "Enforce Proper Line Breaks Around Pipes and Logical Operators",
946
+ enabled: false,
947
+ parameters: []
948
+ },
949
+ {
950
+ id: "shellcheck_SC1134",
951
+ category: "ErrorProne",
952
+ severityLevel: "High",
953
+ title: "Fix Errors in shellcheckrc Configuration File",
954
+ enabled: false,
955
+ parameters: []
956
+ },
957
+ {
958
+ id: "shellcheck_SC1135",
959
+ category: "CodeStyle",
960
+ severityLevel: "Info",
961
+ title: "Prefer escaping dollar sign to ending quote for literal `$`",
962
+ enabled: false,
963
+ parameters: []
964
+ },
965
+ {
966
+ id: "shellcheck_SC1137",
967
+ category: "ErrorProne",
968
+ severityLevel: "High",
969
+ title: "Enforce Correct Use of Double Parentheses in Arithmetic For Loops",
970
+ enabled: false,
971
+ parameters: []
972
+ },
973
+ {
974
+ id: "shellcheck_SC1138",
975
+ category: "ErrorProne",
976
+ severityLevel: "High",
977
+ title: "Remove spaces between (( in arithmetic for loop",
978
+ enabled: false,
979
+ parameters: []
980
+ },
981
+ {
982
+ id: "shellcheck_SC1139",
983
+ category: "ErrorProne",
984
+ severityLevel: "High",
985
+ title: "Use Logical Operators (`||` or `&&`) Instead of `-o` or `-a` Between Test Commands",
986
+ enabled: false,
987
+ parameters: []
988
+ },
989
+ {
990
+ id: "shellcheck_SC1140",
991
+ category: "ErrorProne",
992
+ severityLevel: "High",
993
+ title: "Detect Unexpected Parameters After Condition in Shell Test Expressions",
994
+ enabled: false,
995
+ parameters: []
996
+ },
997
+ {
998
+ id: "shellcheck_SC1141",
999
+ category: "ErrorProne",
1000
+ severityLevel: "High",
1001
+ title: "Avoid Unexpected Tokens After Compound Commands",
1002
+ enabled: false,
1003
+ parameters: []
1004
+ },
1005
+ {
1006
+ id: "shellcheck_SC1142",
1007
+ category: "ErrorProne",
1008
+ severityLevel: "High",
1009
+ title: "Enforce correct process substitution redirection syntax",
1010
+ enabled: false,
1011
+ parameters: []
1012
+ },
1013
+ {
1014
+ id: "shellcheck_SC1143",
1015
+ category: "ErrorProne",
1016
+ severityLevel: "Warning",
1017
+ title: "Avoid Backslash Line Continuation in Comments",
1018
+ enabled: false,
1019
+ parameters: []
1020
+ },
1021
+ {
1022
+ id: "shellcheck_SC1144",
1023
+ category: "BestPractice",
1024
+ severityLevel: "Warning",
1025
+ title: "Enforce enabling external-sources only in .shellcheckrc",
1026
+ enabled: false,
1027
+ parameters: []
1028
+ },
1029
+ {
1030
+ id: "shellcheck_SC1145",
1031
+ category: "ErrorProne",
1032
+ severityLevel: "Warning",
1033
+ title: "Enforce Valid `external-sources` Value",
1034
+ enabled: false,
1035
+ parameters: []
1036
+ },
1037
+ {
1038
+ id: "shellcheck_SC2000",
1039
+ category: "Performance",
1040
+ severityLevel: "Info",
1041
+ title: "Use `${#variable}` to Get String Length",
1042
+ enabled: false,
1043
+ parameters: []
1044
+ },
1045
+ {
1046
+ id: "shellcheck_SC2001",
1047
+ category: "Performance",
1048
+ severityLevel: "Warning",
1049
+ title: "Use Bash Parameter Expansion for Search and Replace",
1050
+ enabled: true,
1051
+ parameters: []
1052
+ },
1053
+ {
1054
+ id: "shellcheck_SC2002",
1055
+ category: "Performance",
1056
+ severityLevel: "Info",
1057
+ title: "Avoid Useless Use of cat",
1058
+ enabled: true,
1059
+ parameters: []
1060
+ },
1061
+ {
1062
+ id: "shellcheck_SC2003",
1063
+ category: "BestPractice",
1064
+ severityLevel: "Warning",
1065
+ title: "Avoid Using expr; Use Modern Shell Arithmetic and String Features",
1066
+ enabled: true,
1067
+ parameters: []
1068
+ },
1069
+ {
1070
+ id: "shellcheck_SC2004",
1071
+ category: "ErrorProne",
1072
+ severityLevel: "Warning",
1073
+ title: "Avoid Unnecessary Use of `$` or `${}` in Arithmetic Variables",
1074
+ enabled: true,
1075
+ parameters: []
1076
+ },
1077
+ {
1078
+ id: "shellcheck_SC2005",
1079
+ category: "Performance",
1080
+ severityLevel: "Warning",
1081
+ title: "Avoid Useless echo with Command Substitution",
1082
+ enabled: false,
1083
+ parameters: []
1084
+ },
1085
+ {
1086
+ id: "shellcheck_SC2006",
1087
+ category: "BestPractice",
1088
+ severityLevel: "Info",
1089
+ title: "Use $(...) Notation Instead of Legacy Backticked Command Substitution",
1090
+ enabled: true,
1091
+ parameters: []
1092
+ },
1093
+ {
1094
+ id: "shellcheck_SC2007",
1095
+ category: "Compatibility",
1096
+ severityLevel: "Warning",
1097
+ title: "Use $((..)) Instead of Deprecated $[..]",
1098
+ enabled: false,
1099
+ parameters: []
1100
+ },
1101
+ {
1102
+ id: "shellcheck_SC2009",
1103
+ category: "Performance",
1104
+ severityLevel: "Warning",
1105
+ title: "Use pgrep Instead of Grepping ps Output",
1106
+ enabled: false,
1107
+ parameters: []
1108
+ },
1109
+ {
1110
+ id: "shellcheck_SC2010",
1111
+ category: "BestPractice",
1112
+ severityLevel: "Warning",
1113
+ title: "Avoid Using ls with grep; Use Globs or For Loops for Filename Matching",
1114
+ enabled: false,
1115
+ parameters: []
1116
+ },
1117
+ {
1118
+ id: "shellcheck_SC2011",
1119
+ category: "BestPractice",
1120
+ severityLevel: "Warning",
1121
+ title: "Use find -print0 or find -exec to handle non-alphanumeric filenames",
1122
+ enabled: false,
1123
+ parameters: []
1124
+ },
1125
+ {
1126
+ id: "shellcheck_SC2012",
1127
+ category: "BestPractice",
1128
+ severityLevel: "Warning",
1129
+ title: "Use find Instead of ls to Handle Non-Alphanumeric Filenames Correctly",
1130
+ enabled: false,
1131
+ parameters: []
1132
+ },
1133
+ {
1134
+ id: "shellcheck_SC2013",
1135
+ category: "ErrorProne",
1136
+ severityLevel: "Warning",
1137
+ title: "Use while read loop to read lines instead of for loop",
1138
+ enabled: false,
1139
+ parameters: []
1140
+ },
1141
+ {
1142
+ id: "shellcheck_SC2014",
1143
+ category: "ErrorProne",
1144
+ severityLevel: "High",
1145
+ title: "Avoid premature expansion in find -exec commands",
1146
+ enabled: false,
1147
+ parameters: []
1148
+ },
1149
+ {
1150
+ id: "shellcheck_SC2015",
1151
+ category: "ErrorProne",
1152
+ severityLevel: "High",
1153
+ title: "Avoid Using `A && B || C` as if-Then-Else",
1154
+ enabled: true,
1155
+ parameters: []
1156
+ },
1157
+ {
1158
+ id: "shellcheck_SC2016",
1159
+ category: "BestPractice",
1160
+ severityLevel: "Warning",
1161
+ title: "Avoid Using Single Quotes for Expressions That Need Expansion",
1162
+ enabled: true,
1163
+ parameters: []
1164
+ },
1165
+ {
1166
+ id: "shellcheck_SC2017",
1167
+ category: "ErrorProne",
1168
+ severityLevel: "Warning",
1169
+ title: "Increase Precision by Reordering Arithmetic Expressions",
1170
+ enabled: false,
1171
+ parameters: []
1172
+ },
1173
+ {
1174
+ id: "shellcheck_SC2018",
1175
+ category: "BestPractice",
1176
+ severityLevel: "Warning",
1177
+ title: "Use POSIX Character Classes for Case Conversion",
1178
+ enabled: false,
1179
+ parameters: []
1180
+ },
1181
+ {
1182
+ id: "shellcheck_SC2019",
1183
+ category: "BestPractice",
1184
+ severityLevel: "Warning",
1185
+ title: "Use POSIX Character Class [:upper:] for Uppercase Matching",
1186
+ enabled: false,
1187
+ parameters: []
1188
+ },
1189
+ {
1190
+ id: "shellcheck_SC2020",
1191
+ category: "ErrorProne",
1192
+ severityLevel: "High",
1193
+ title: "Avoid Using 'tr' for Word Replacement",
1194
+ enabled: true,
1195
+ parameters: []
1196
+ },
1197
+ {
1198
+ id: "shellcheck_SC2021",
1199
+ category: "ErrorProne",
1200
+ severityLevel: "Warning",
1201
+ title: "Avoid Using Square Brackets Around Ranges in tr",
1202
+ enabled: false,
1203
+ parameters: []
1204
+ },
1205
+ {
1206
+ id: "shellcheck_SC2022",
1207
+ category: "ErrorProne",
1208
+ severityLevel: "Warning",
1209
+ title: "Avoid Misusing Glob Patterns as Regular Expressions",
1210
+ enabled: true,
1211
+ parameters: []
1212
+ },
1213
+ {
1214
+ id: "shellcheck_SC2023",
1215
+ category: "BestPractice",
1216
+ severityLevel: "Warning",
1217
+ title: "Avoid shell overriding of time command",
1218
+ enabled: false,
1219
+ parameters: []
1220
+ },
1221
+ {
1222
+ id: "shellcheck_SC2024",
1223
+ category: "ErrorProne",
1224
+ severityLevel: "High",
1225
+ title: "Avoid Using sudo with Redirections; Use sudo tee Instead",
1226
+ enabled: true,
1227
+ parameters: []
1228
+ },
1229
+ {
1230
+ id: "shellcheck_SC2025",
1231
+ category: "ErrorProne",
1232
+ severityLevel: "Warning",
1233
+ title: "Enforce enclosing escape sequences in \\[..\\] in Bash prompts",
1234
+ enabled: true,
1235
+ parameters: []
1236
+ },
1237
+ {
1238
+ id: "shellcheck_SC2026",
1239
+ category: "ErrorProne",
1240
+ severityLevel: "High",
1241
+ title: "Avoid Unquoted Words Outside Quotes in Shell Strings",
1242
+ enabled: true,
1243
+ parameters: []
1244
+ },
1245
+ {
1246
+ id: "shellcheck_SC2027",
1247
+ category: "ErrorProne",
1248
+ severityLevel: "Warning",
1249
+ title: "Avoid Unquoting Variables by Surrounding Quotes",
1250
+ enabled: true,
1251
+ parameters: []
1252
+ },
1253
+ {
1254
+ id: "shellcheck_SC2028",
1255
+ category: "BestPractice",
1256
+ severityLevel: "Warning",
1257
+ title: "Avoid using echo for escape sequences; use printf instead",
1258
+ enabled: true,
1259
+ parameters: []
1260
+ },
1261
+ {
1262
+ id: "shellcheck_SC2029",
1263
+ category: "ErrorProne",
1264
+ severityLevel: "Warning",
1265
+ title: "Avoid Unescaped Client-Side Expansion in SSH Commands",
1266
+ enabled: true,
1267
+ parameters: []
1268
+ },
1269
+ {
1270
+ id: "shellcheck_SC2030",
1271
+ category: "ErrorProne",
1272
+ severityLevel: "High",
1273
+ title: "Avoid Local Modification of Variables in Pipeline Subshells",
1274
+ enabled: false,
1275
+ parameters: []
1276
+ },
1277
+ {
1278
+ id: "shellcheck_SC2031",
1279
+ category: "ErrorProne",
1280
+ severityLevel: "High",
1281
+ title: "Avoid modifying variables in a subshell where changes are lost",
1282
+ enabled: true,
1283
+ parameters: []
1284
+ },
1285
+ {
1286
+ id: "shellcheck_SC2032",
1287
+ category: "ErrorProne",
1288
+ severityLevel: "High",
1289
+ title: "Avoid Invoking Functions via su or Similar Commands",
1290
+ enabled: false,
1291
+ parameters: []
1292
+ },
1293
+ {
1294
+ id: "shellcheck_SC2033",
1295
+ category: "ErrorProne",
1296
+ severityLevel: "High",
1297
+ title: "Avoid Passing Shell Functions to External Commands",
1298
+ enabled: true,
1299
+ parameters: []
1300
+ },
1301
+ {
1302
+ id: "shellcheck_SC2034",
1303
+ category: "ErrorProne",
1304
+ severityLevel: "Warning",
1305
+ title: "Avoid Unused Variables",
1306
+ enabled: true,
1307
+ parameters: []
1308
+ },
1309
+ {
1310
+ id: "shellcheck_SC2035",
1311
+ category: "ErrorProne",
1312
+ severityLevel: "High",
1313
+ title: "Avoid glob patterns that cause filenames with dashes to be treated as options",
1314
+ enabled: true,
1315
+ parameters: []
1316
+ },
1317
+ {
1318
+ id: "shellcheck_SC2036",
1319
+ category: "ErrorProne",
1320
+ severityLevel: "High",
1321
+ title: "Use Command Substitution to Assign Pipeline Output",
1322
+ enabled: true,
1323
+ parameters: []
1324
+ },
1325
+ {
1326
+ id: "shellcheck_SC2037",
1327
+ category: "ErrorProne",
1328
+ severityLevel: "High",
1329
+ title: "Use Command Substitution for Variable Assignment",
1330
+ enabled: false,
1331
+ parameters: []
1332
+ },
1333
+ {
1334
+ id: "shellcheck_SC2038",
1335
+ category: "BestPractice",
1336
+ severityLevel: "Warning",
1337
+ title: "Use -print0/-0 or find -exec + to Support Non-Alphanumeric Filenames",
1338
+ enabled: false,
1339
+ parameters: []
1340
+ },
1341
+ {
1342
+ id: "shellcheck_SC2041",
1343
+ category: "ErrorProne",
1344
+ severityLevel: "High",
1345
+ title: "Avoid Using Single Quotes for Command Substitution",
1346
+ enabled: false,
1347
+ parameters: []
1348
+ },
1349
+ {
1350
+ id: "shellcheck_SC2042",
1351
+ category: "ErrorProne",
1352
+ severityLevel: "Warning",
1353
+ title: "Use spaces to separate loop elements",
1354
+ enabled: false,
1355
+ parameters: []
1356
+ },
1357
+ {
1358
+ id: "shellcheck_SC2043",
1359
+ category: "ErrorProne",
1360
+ severityLevel: "High",
1361
+ title: "Avoid For Loops Over Single Constant Values",
1362
+ enabled: false,
1363
+ parameters: []
1364
+ },
1365
+ {
1366
+ id: "shellcheck_SC2044",
1367
+ category: "ErrorProne",
1368
+ severityLevel: "High",
1369
+ title: "Avoid For Loops Over Find Output",
1370
+ enabled: false,
1371
+ parameters: []
1372
+ },
1373
+ {
1374
+ id: "shellcheck_SC2045",
1375
+ category: "BestPractice",
1376
+ severityLevel: "Warning",
1377
+ title: "Avoid Iterating Over ls Output; Use Globs Instead",
1378
+ enabled: false,
1379
+ parameters: []
1380
+ },
1381
+ {
1382
+ id: "shellcheck_SC2046",
1383
+ category: "ErrorProne",
1384
+ severityLevel: "High",
1385
+ title: "Quote Command Substitutions to Prevent Word Splitting",
1386
+ enabled: false,
1387
+ parameters: []
1388
+ },
1389
+ {
1390
+ id: "shellcheck_SC2048",
1391
+ category: "ErrorProne",
1392
+ severityLevel: "High",
1393
+ title: 'Use Quoted "$@" to Prevent Whitespace Problems',
1394
+ enabled: false,
1395
+ parameters: []
1396
+ },
1397
+ {
1398
+ id: "shellcheck_SC2049",
1399
+ category: "ErrorProne",
1400
+ severityLevel: "Warning",
1401
+ title: "Avoid Using =~ for Glob Patterns; Use = Instead",
1402
+ enabled: false,
1403
+ parameters: []
1404
+ },
1405
+ {
1406
+ id: "shellcheck_SC2050",
1407
+ category: "ErrorProne",
1408
+ severityLevel: "High",
1409
+ title: "Detect Constant Expressions Due to Missing Variable Expansion",
1410
+ enabled: false,
1411
+ parameters: []
1412
+ },
1413
+ {
1414
+ id: "shellcheck_SC2051",
1415
+ category: "ErrorProne",
1416
+ severityLevel: "Warning",
1417
+ title: "Avoid Using Variables in Bash Brace Range Expansions",
1418
+ enabled: false,
1419
+ parameters: []
1420
+ },
1421
+ {
1422
+ id: "shellcheck_SC2053",
1423
+ category: "ErrorProne",
1424
+ severityLevel: "High",
1425
+ title: "Quote Right-Hand Side of '=' in [[ ]] to Prevent Glob Matching",
1426
+ enabled: false,
1427
+ parameters: []
1428
+ },
1429
+ {
1430
+ id: "shellcheck_SC2054",
1431
+ category: "ErrorProne",
1432
+ severityLevel: "Warning",
1433
+ title: "Use spaces to separate array elements in Bash arrays",
1434
+ enabled: false,
1435
+ parameters: []
1436
+ },
1437
+ {
1438
+ id: "shellcheck_SC2055",
1439
+ category: "ErrorProne",
1440
+ severityLevel: "High",
1441
+ title: "Avoid Using `||` Instead of `&&` in Negated Conditions",
1442
+ enabled: false,
1443
+ parameters: []
1444
+ },
1445
+ {
1446
+ id: "shellcheck_SC2056",
1447
+ category: "ErrorProne",
1448
+ severityLevel: "High",
1449
+ title: "Avoid Incorrect Logical OR Instead of AND",
1450
+ enabled: false,
1451
+ parameters: []
1452
+ },
1453
+ {
1454
+ id: "shellcheck_SC2057",
1455
+ category: "ErrorProne",
1456
+ severityLevel: "High",
1457
+ title: "Avoid Unknown Binary Operators in Test Expressions",
1458
+ enabled: false,
1459
+ parameters: []
1460
+ },
1461
+ {
1462
+ id: "shellcheck_SC2058",
1463
+ category: "ErrorProne",
1464
+ severityLevel: "Warning",
1465
+ title: "Avoid Unknown Unary Operators in Test Expressions",
1466
+ enabled: false,
1467
+ parameters: []
1468
+ },
1469
+ {
1470
+ id: "shellcheck_SC2059",
1471
+ category: "ErrorProne",
1472
+ severityLevel: "High",
1473
+ title: "Avoid Using Variables Directly in printf Format String",
1474
+ enabled: false,
1475
+ parameters: []
1476
+ },
1477
+ {
1478
+ id: "shellcheck_SC2060",
1479
+ category: "ErrorProne",
1480
+ severityLevel: "High",
1481
+ title: "Quote parameters to `tr` to prevent glob expansion",
1482
+ enabled: false,
1483
+ parameters: []
1484
+ },
1485
+ {
1486
+ id: "shellcheck_SC2061",
1487
+ category: "ErrorProne",
1488
+ severityLevel: "High",
1489
+ title: "Quote the parameter to -name in find command",
1490
+ enabled: false,
1491
+ parameters: []
1492
+ },
1493
+ {
1494
+ id: "shellcheck_SC2062",
1495
+ category: "ErrorProne",
1496
+ severityLevel: "High",
1497
+ title: "Quote grep Pattern to Prevent Shell Interpretation",
1498
+ enabled: false,
1499
+ parameters: []
1500
+ },
1501
+ {
1502
+ id: "shellcheck_SC2063",
1503
+ category: "ErrorProne",
1504
+ severityLevel: "Warning",
1505
+ title: "Avoid Using Globs in Grep Patterns",
1506
+ enabled: false,
1507
+ parameters: []
1508
+ },
1509
+ {
1510
+ id: "shellcheck_SC2064",
1511
+ category: "BestPractice",
1512
+ severityLevel: "Warning",
1513
+ title: "Enforce Use of Single Quotes in trap Commands",
1514
+ enabled: false,
1515
+ parameters: []
1516
+ },
1517
+ {
1518
+ id: "shellcheck_SC2065",
1519
+ category: "ErrorProne",
1520
+ severityLevel: "High",
1521
+ title: "Avoid Misinterpreting Redirection as Comparison in Shell Test Expressions",
1522
+ enabled: false,
1523
+ parameters: []
1524
+ },
1525
+ {
1526
+ id: "shellcheck_SC2066",
1527
+ category: "ErrorProne",
1528
+ severityLevel: "Warning",
1529
+ title: "Avoid Double-Quoting in For Loop to Enable Word Splitting",
1530
+ enabled: false,
1531
+ parameters: []
1532
+ },
1533
+ {
1534
+ id: "shellcheck_SC2067",
1535
+ category: "ErrorProne",
1536
+ severityLevel: "High",
1537
+ title: "Enforce Correct Termination of find -exec",
1538
+ enabled: false,
1539
+ parameters: []
1540
+ },
1541
+ {
1542
+ id: "shellcheck_SC2068",
1543
+ category: "ErrorProne",
1544
+ severityLevel: "High",
1545
+ title: "Double Quote Array Expansions to Avoid Re-splitting Elements",
1546
+ enabled: false,
1547
+ parameters: []
1548
+ },
1549
+ {
1550
+ id: "shellcheck_SC2069",
1551
+ category: "BestPractice",
1552
+ severityLevel: "Warning",
1553
+ title: "Enforce Correct Order of stdout and stderr Redirection",
1554
+ enabled: false,
1555
+ parameters: []
1556
+ },
1557
+ {
1558
+ id: "shellcheck_SC2070",
1559
+ category: "ErrorProne",
1560
+ severityLevel: "High",
1561
+ title: "Quote or Use [[ ]] with -n to Check Variable Non-Emptiness",
1562
+ enabled: false,
1563
+ parameters: []
1564
+ },
1565
+ {
1566
+ id: "shellcheck_SC2071",
1567
+ category: "ErrorProne",
1568
+ severityLevel: "High",
1569
+ title: "Use Numeric Comparison Operators Instead of String Comparison Operators",
1570
+ enabled: false,
1571
+ parameters: []
1572
+ },
1573
+ {
1574
+ id: "shellcheck_SC2072",
1575
+ category: "ErrorProne",
1576
+ severityLevel: "High",
1577
+ title: "Avoid Using Decimals in Integer Comparisons",
1578
+ enabled: false,
1579
+ parameters: []
1580
+ },
1581
+ {
1582
+ id: "shellcheck_SC2073",
1583
+ category: "ErrorProne",
1584
+ severityLevel: "High",
1585
+ title: "Escape `<` and `>` in test expressions or use `[[ .. ]]` for string comparison",
1586
+ enabled: false,
1587
+ parameters: []
1588
+ },
1589
+ {
1590
+ id: "shellcheck_SC2074",
1591
+ category: "ErrorProne",
1592
+ severityLevel: "High",
1593
+ title: "Enforce Use of [[..]] for =~ Operator",
1594
+ enabled: false,
1595
+ parameters: []
1596
+ },
1597
+ {
1598
+ id: "shellcheck_SC2075",
1599
+ category: "ErrorProne",
1600
+ severityLevel: "High",
1601
+ title: "Enforce Correct Escaping of `<` in Test Constructs",
1602
+ enabled: false,
1603
+ parameters: []
1604
+ },
1605
+ {
1606
+ id: "shellcheck_SC2076",
1607
+ category: "ErrorProne",
1608
+ severityLevel: "Warning",
1609
+ title: "Avoid quoting right-hand side of =~ operator in Bash regex",
1610
+ enabled: false,
1611
+ parameters: []
1612
+ },
1613
+ {
1614
+ id: "shellcheck_SC2077",
1615
+ category: "ErrorProne",
1616
+ severityLevel: "High",
1617
+ title: "Enforce Spaces Around Comparison Operators in Shell Conditionals",
1618
+ enabled: false,
1619
+ parameters: []
1620
+ },
1621
+ {
1622
+ id: "shellcheck_SC2078",
1623
+ category: "ErrorProne",
1624
+ severityLevel: "High",
1625
+ title: "Avoid Constant Expressions in Conditional Tests",
1626
+ enabled: false,
1627
+ parameters: []
1628
+ },
1629
+ {
1630
+ id: "shellcheck_SC2079",
1631
+ category: "ErrorProne",
1632
+ severityLevel: "High",
1633
+ title: "Avoid Using (( )) for Decimal Arithmetic",
1634
+ enabled: false,
1635
+ parameters: []
1636
+ },
1637
+ {
1638
+ id: "shellcheck_SC2080",
1639
+ category: "ErrorProne",
1640
+ severityLevel: "High",
1641
+ title: "Avoid Numbers with Leading Zero Interpreted as Octal",
1642
+ enabled: false,
1643
+ parameters: []
1644
+ },
1645
+ {
1646
+ id: "shellcheck_SC2081",
1647
+ category: "ErrorProne",
1648
+ severityLevel: "High",
1649
+ title: "Avoid Using [ .. ] for Glob Matching; Use [[ .. ]] or grep Instead",
1650
+ enabled: false,
1651
+ parameters: []
1652
+ },
1653
+ {
1654
+ id: "shellcheck_SC2082",
1655
+ category: "ErrorProne",
1656
+ severityLevel: "High",
1657
+ title: "Use Indirect Expansion for Dynamic Variable Names",
1658
+ enabled: false,
1659
+ parameters: []
1660
+ },
1661
+ {
1662
+ id: "shellcheck_SC2083",
1663
+ category: "ErrorProne",
1664
+ severityLevel: "Warning",
1665
+ title: "Avoid spaces after './' when running a file",
1666
+ enabled: false,
1667
+ parameters: []
1668
+ },
1669
+ {
1670
+ id: "shellcheck_SC2084",
1671
+ category: "ErrorProne",
1672
+ severityLevel: "High",
1673
+ title: "Avoid Using $((expr)) Alone to Prevent Execution of Output",
1674
+ enabled: false,
1675
+ parameters: []
1676
+ },
1677
+ {
1678
+ id: "shellcheck_SC2086",
1679
+ category: "BestPractice",
1680
+ severityLevel: "Warning",
1681
+ title: "Enforce Double Quoting to Prevent Globbing and Word Splitting",
1682
+ enabled: true,
1683
+ parameters: []
1684
+ },
1685
+ {
1686
+ id: "shellcheck_SC2087",
1687
+ category: "ErrorProne",
1688
+ severityLevel: "Warning",
1689
+ title: "Quote EOF to Prevent Local Expansion in Here Documents",
1690
+ enabled: false,
1691
+ parameters: []
1692
+ },
1693
+ {
1694
+ id: "shellcheck_SC2088",
1695
+ category: "ErrorProne",
1696
+ severityLevel: "Warning",
1697
+ title: "Avoid Using Tilde Inside Quotes; Use $HOME Instead",
1698
+ enabled: false,
1699
+ parameters: []
1700
+ },
1701
+ {
1702
+ id: "shellcheck_SC2089",
1703
+ category: "ErrorProne",
1704
+ severityLevel: "High",
1705
+ title: "Avoid Using Quotes/Backslashes Literally in Argument Strings; Use Arrays Instead",
1706
+ enabled: false,
1707
+ parameters: []
1708
+ },
1709
+ {
1710
+ id: "shellcheck_SC2090",
1711
+ category: "ErrorProne",
1712
+ severityLevel: "Warning",
1713
+ title: "Avoid Using Quotes or Backslashes in Variables That Will Not Be Respected",
1714
+ enabled: false,
1715
+ parameters: []
1716
+ },
1717
+ {
1718
+ id: "shellcheck_SC2091",
1719
+ category: "ErrorProne",
1720
+ severityLevel: "Warning",
1721
+ title: "Avoid Surrounding Command Substitution with $() to Execute Output",
1722
+ enabled: false,
1723
+ parameters: []
1724
+ },
1725
+ {
1726
+ id: "shellcheck_SC2092",
1727
+ category: "Security",
1728
+ severityLevel: "High",
1729
+ title: "Avoid Using Backticks for Command Substitution",
1730
+ enabled: false,
1731
+ parameters: []
1732
+ },
1733
+ {
1734
+ id: "shellcheck_SC2093",
1735
+ category: "ErrorProne",
1736
+ severityLevel: "Warning",
1737
+ title: "Remove exec if script should continue after this command",
1738
+ enabled: false,
1739
+ parameters: []
1740
+ },
1741
+ {
1742
+ id: "shellcheck_SC2094",
1743
+ category: "ErrorProne",
1744
+ severityLevel: "High",
1745
+ title: "Avoid reading and writing the same file in the same pipeline",
1746
+ enabled: false,
1747
+ parameters: []
1748
+ },
1749
+ {
1750
+ id: "shellcheck_SC2095",
1751
+ category: "ErrorProne",
1752
+ severityLevel: "High",
1753
+ title: "Use ssh -n to prevent ssh from swallowing stdin",
1754
+ enabled: false,
1755
+ parameters: []
1756
+ },
1757
+ {
1758
+ id: "shellcheck_SC2096",
1759
+ category: "ErrorProne",
1760
+ severityLevel: "High",
1761
+ title: "Enforce Single Parameter in Shebang",
1762
+ enabled: false,
1763
+ parameters: []
1764
+ },
1765
+ {
1766
+ id: "shellcheck_SC2097",
1767
+ category: "ErrorProne",
1768
+ severityLevel: "High",
1769
+ title: "Avoid Assignments Only Seen by Forked Process",
1770
+ enabled: false,
1771
+ parameters: []
1772
+ },
1773
+ {
1774
+ id: "shellcheck_SC2098",
1775
+ category: "ErrorProne",
1776
+ severityLevel: "High",
1777
+ title: "Avoid expansions that do not see the mentioned assignment",
1778
+ enabled: false,
1779
+ parameters: []
1780
+ },
1781
+ {
1782
+ id: "shellcheck_SC2099",
1783
+ category: "ErrorProne",
1784
+ severityLevel: "High",
1785
+ title: "Use Arithmetic Expansion for Arithmetic Operations",
1786
+ enabled: false,
1787
+ parameters: []
1788
+ },
1789
+ {
1790
+ id: "shellcheck_SC2100",
1791
+ category: "ErrorProne",
1792
+ severityLevel: "High",
1793
+ title: "Use Arithmetic Expansion $((..)) for Arithmetic Operations",
1794
+ enabled: false,
1795
+ parameters: []
1796
+ },
1797
+ {
1798
+ id: "shellcheck_SC2101",
1799
+ category: "ErrorProne",
1800
+ severityLevel: "Warning",
1801
+ title: "Enforce Named Character Classes to Have Outer Brackets",
1802
+ enabled: false,
1803
+ parameters: []
1804
+ },
1805
+ {
1806
+ id: "shellcheck_SC2102",
1807
+ category: "ErrorProne",
1808
+ severityLevel: "Warning",
1809
+ title: "Avoid Using Duplicate Characters in Glob Ranges",
1810
+ enabled: false,
1811
+ parameters: []
1812
+ },
1813
+ {
1814
+ id: "shellcheck_SC2103",
1815
+ category: "ErrorProne",
1816
+ severityLevel: "High",
1817
+ title: "Use a subshell to avoid having to cd back",
1818
+ enabled: false,
1819
+ parameters: []
1820
+ },
1821
+ {
1822
+ id: "shellcheck_SC2104",
1823
+ category: "ErrorProne",
1824
+ severityLevel: "High",
1825
+ title: "Use return Instead of break to Exit Functions",
1826
+ enabled: false,
1827
+ parameters: []
1828
+ },
1829
+ {
1830
+ id: "shellcheck_SC2105",
1831
+ category: "ErrorProne",
1832
+ severityLevel: "High",
1833
+ title: "Avoid Using `break` Outside of Loops",
1834
+ enabled: false,
1835
+ parameters: []
1836
+ },
1837
+ {
1838
+ id: "shellcheck_SC2106",
1839
+ category: "ErrorProne",
1840
+ severityLevel: "High",
1841
+ title: "Avoid Using 'break' in Pipeline Subshells",
1842
+ enabled: false,
1843
+ parameters: []
1844
+ },
1845
+ {
1846
+ id: "shellcheck_SC2107",
1847
+ category: "ErrorProne",
1848
+ severityLevel: "High",
1849
+ title: "Use Separate Test Expressions Instead of Combining with && Inside Single Brackets",
1850
+ enabled: false,
1851
+ parameters: []
1852
+ },
1853
+ {
1854
+ id: "shellcheck_SC2108",
1855
+ category: "ErrorProne",
1856
+ severityLevel: "High",
1857
+ title: "Use '&&' Instead of '-a' in [[..]] Expressions",
1858
+ enabled: false,
1859
+ parameters: []
1860
+ },
1861
+ {
1862
+ id: "shellcheck_SC2109",
1863
+ category: "ErrorProne",
1864
+ severityLevel: "High",
1865
+ title: "Use Separate Test Expressions with Logical OR",
1866
+ enabled: false,
1867
+ parameters: []
1868
+ },
1869
+ {
1870
+ id: "shellcheck_SC2110",
1871
+ category: "ErrorProne",
1872
+ severityLevel: "Warning",
1873
+ title: "Use Logical OR Operator `||` Instead of `-o` in `[[..]]`",
1874
+ enabled: false,
1875
+ parameters: []
1876
+ },
1877
+ {
1878
+ id: "shellcheck_SC2111",
1879
+ category: "Compatibility",
1880
+ severityLevel: "Warning",
1881
+ title: "Avoid Using `function` Keyword with `()` in ksh Function Definitions",
1882
+ enabled: false,
1883
+ parameters: []
1884
+ },
1885
+ {
1886
+ id: "shellcheck_SC2112",
1887
+ category: "Compatibility",
1888
+ severityLevel: "Warning",
1889
+ title: "Avoid using `function` keyword for function declaration in POSIX shell scripts",
1890
+ enabled: false,
1891
+ parameters: []
1892
+ },
1893
+ {
1894
+ id: "shellcheck_SC2113",
1895
+ category: "Compatibility",
1896
+ severityLevel: "Warning",
1897
+ title: "Avoid Using Non-Standard `function` Keyword for Function Definitions",
1898
+ enabled: false,
1899
+ parameters: []
1900
+ },
1901
+ {
1902
+ id: "shellcheck_SC2114",
1903
+ category: "ErrorProne",
1904
+ severityLevel: "Error",
1905
+ title: "Avoid Accidental Deletion of System Directories",
1906
+ enabled: false,
1907
+ parameters: []
1908
+ },
1909
+ {
1910
+ id: "shellcheck_SC2115",
1911
+ category: "Security",
1912
+ severityLevel: "Error",
1913
+ title: 'Enforce use of "${var:?}" to prevent unsafe expansion',
1914
+ enabled: false,
1915
+ parameters: []
1916
+ },
1917
+ {
1918
+ id: "shellcheck_SC2116",
1919
+ category: "Performance",
1920
+ severityLevel: "Info",
1921
+ title: "Avoid Useless Echo in Command Substitution",
1922
+ enabled: false,
1923
+ parameters: []
1924
+ },
1925
+ {
1926
+ id: "shellcheck_SC2117",
1927
+ category: "BestPractice",
1928
+ severityLevel: "Warning",
1929
+ title: "Use su -c or sudo to Run Commands as Another User",
1930
+ enabled: false,
1931
+ parameters: []
1932
+ },
1933
+ {
1934
+ id: "shellcheck_SC2118",
1935
+ category: "Compatibility",
1936
+ severityLevel: "High",
1937
+ title: "Avoid using Bash-specific '|&' in Ksh scripts",
1938
+ enabled: false,
1939
+ parameters: []
1940
+ },
1941
+ {
1942
+ id: "shellcheck_SC2119",
1943
+ category: "ErrorProne",
1944
+ severityLevel: "Warning",
1945
+ title: 'Use `foo "$@"` to Pass All Script Arguments to Functions',
1946
+ enabled: false,
1947
+ parameters: []
1948
+ },
1949
+ {
1950
+ id: "shellcheck_SC2120",
1951
+ category: "ErrorProne",
1952
+ severityLevel: "Warning",
1953
+ title: "Avoid referencing arguments in functions without passing them",
1954
+ enabled: false,
1955
+ parameters: []
1956
+ },
1957
+ {
1958
+ id: "shellcheck_SC2121",
1959
+ category: "ErrorProne",
1960
+ severityLevel: "Warning",
1961
+ title: "Avoid Using 'set' to Assign Variables",
1962
+ enabled: false,
1963
+ parameters: []
1964
+ },
1965
+ {
1966
+ id: "shellcheck_SC2122",
1967
+ category: "ErrorProne",
1968
+ severityLevel: "High",
1969
+ title: "Avoid Using Invalid '>=' Operator in Shell Scripts",
1970
+ enabled: false,
1971
+ parameters: []
1972
+ },
1973
+ {
1974
+ id: "shellcheck_SC2123",
1975
+ category: "ErrorProne",
1976
+ severityLevel: "High",
1977
+ title: "Avoid Overwriting PATH Variable",
1978
+ enabled: false,
1979
+ parameters: []
1980
+ },
1981
+ {
1982
+ id: "shellcheck_SC2124",
1983
+ category: "ErrorProne",
1984
+ severityLevel: "High",
1985
+ title: "Avoid Assigning Array to String Without Proper Handling",
1986
+ enabled: false,
1987
+ parameters: []
1988
+ },
1989
+ {
1990
+ id: "shellcheck_SC2125",
1991
+ category: "ErrorProne",
1992
+ severityLevel: "Warning",
1993
+ title: "Enforce Quoting or Array Usage for Brace Expansions and Globs in Assignments",
1994
+ enabled: false,
1995
+ parameters: []
1996
+ },
1997
+ {
1998
+ id: "shellcheck_SC2126",
1999
+ category: "CodeStyle",
2000
+ severityLevel: "Info",
2001
+ title: "Consider using grep -c instead of grep | wc",
2002
+ enabled: false,
2003
+ parameters: []
2004
+ },
2005
+ {
2006
+ id: "shellcheck_SC2127",
2007
+ category: "Compatibility",
2008
+ severityLevel: "Warning",
2009
+ title: "Enforce Correct Shell Interpreter for `${ ..; }` Syntax",
2010
+ enabled: false,
2011
+ parameters: []
2012
+ },
2013
+ {
2014
+ id: "shellcheck_SC2128",
2015
+ category: "ErrorProne",
2016
+ severityLevel: "Warning",
2017
+ title: "Avoid Expanding Arrays Without an Index",
2018
+ enabled: false,
2019
+ parameters: []
2020
+ },
2021
+ {
2022
+ id: "shellcheck_SC2129",
2023
+ category: "Performance",
2024
+ severityLevel: "Info",
2025
+ title: "Consider grouping commands for output redirection",
2026
+ enabled: false,
2027
+ parameters: []
2028
+ },
2029
+ {
2030
+ id: "shellcheck_SC2139",
2031
+ category: "ErrorProne",
2032
+ severityLevel: "Warning",
2033
+ title: "Avoid Early Expansion in Alias Definitions",
2034
+ enabled: false,
2035
+ parameters: []
2036
+ },
2037
+ {
2038
+ id: "shellcheck_SC2140",
2039
+ category: "ErrorProne",
2040
+ severityLevel: "Warning",
2041
+ title: "Avoid Suspiciously Split Double-Quoted Strings",
2042
+ enabled: false,
2043
+ parameters: []
2044
+ },
2045
+ {
2046
+ id: "shellcheck_SC2141",
2047
+ category: "ErrorProne",
2048
+ severityLevel: "Warning",
2049
+ title: "Use Correct Tab Character for IFS",
2050
+ enabled: false,
2051
+ parameters: []
2052
+ },
2053
+ {
2054
+ id: "shellcheck_SC2142",
2055
+ category: "BestPractice",
2056
+ severityLevel: "Warning",
2057
+ title: "Avoid Using Positional Parameters in Aliases; Use Functions Instead",
2058
+ enabled: false,
2059
+ parameters: []
2060
+ },
2061
+ {
2062
+ id: "shellcheck_SC2143",
2063
+ category: "Performance",
2064
+ severityLevel: "Warning",
2065
+ title: "Use grep -q Instead of Comparing Output with [ -n .. ]",
2066
+ enabled: false,
2067
+ parameters: []
2068
+ },
2069
+ {
2070
+ id: "shellcheck_SC2144",
2071
+ category: "ErrorProne",
2072
+ severityLevel: "Warning",
2073
+ title: "Avoid Using '-e' Test with Globs; Use a 'for' Loop Instead",
2074
+ enabled: false,
2075
+ parameters: []
2076
+ },
2077
+ {
2078
+ id: "shellcheck_SC2145",
2079
+ category: "ErrorProne",
2080
+ severityLevel: "Warning",
2081
+ title: "Avoid Mixing String and Array Arguments",
2082
+ enabled: false,
2083
+ parameters: []
2084
+ },
2085
+ {
2086
+ id: "shellcheck_SC2146",
2087
+ category: "ErrorProne",
2088
+ severityLevel: "Warning",
2089
+ title: "Enforce Proper Grouping with \\( \\) in find Command to Control Logical Operators",
2090
+ enabled: false,
2091
+ parameters: []
2092
+ },
2093
+ {
2094
+ id: "shellcheck_SC2147",
2095
+ category: "Compatibility",
2096
+ severityLevel: "Warning",
2097
+ title: "Avoid Literal Tilde in PATH",
2098
+ enabled: false,
2099
+ parameters: []
2100
+ },
2101
+ {
2102
+ id: "shellcheck_SC2148",
2103
+ category: "BestPractice",
2104
+ severityLevel: "Warning",
2105
+ title: "Enforce Shebang in Shell Scripts",
2106
+ enabled: true,
2107
+ parameters: []
2108
+ },
2109
+ {
2110
+ id: "shellcheck_SC2150",
2111
+ category: "ErrorProne",
2112
+ severityLevel: "High",
2113
+ title: "Use Shell Invocation with -exec in find",
2114
+ enabled: false,
2115
+ parameters: []
2116
+ },
2117
+ {
2118
+ id: "shellcheck_SC2151",
2119
+ category: "ErrorProne",
2120
+ severityLevel: "High",
2121
+ title: "Enforce Single Integer Return Value 0-255 and Use Stdout for Other Data",
2122
+ enabled: false,
2123
+ parameters: []
2124
+ },
2125
+ {
2126
+ id: "shellcheck_SC2152",
2127
+ category: "ErrorProne",
2128
+ severityLevel: "High",
2129
+ title: "Enforce Return Value Range and Output Data via stdout in Shell Functions",
2130
+ enabled: false,
2131
+ parameters: []
2132
+ },
2133
+ {
2134
+ id: "shellcheck_SC2153",
2135
+ category: "ErrorProne",
2136
+ severityLevel: "Warning",
2137
+ title: "Detect Possible Misspelling of Environment Variables",
2138
+ enabled: false,
2139
+ parameters: []
2140
+ },
2141
+ {
2142
+ id: "shellcheck_SC2154",
2143
+ category: "ErrorProne",
2144
+ severityLevel: "High",
2145
+ title: "Avoid Referencing Unassigned Variables",
2146
+ enabled: false,
2147
+ parameters: []
2148
+ },
2149
+ {
2150
+ id: "shellcheck_SC2155",
2151
+ category: "ErrorProne",
2152
+ severityLevel: "High",
2153
+ title: "Declare and Assign Separately to Avoid Masking Return Values",
2154
+ enabled: false,
2155
+ parameters: []
2156
+ },
2157
+ {
2158
+ id: "shellcheck_SC2156",
2159
+ category: "Security",
2160
+ severityLevel: "Error",
2161
+ title: "Avoid Injecting Filenames in Shell Commands; Use Parameters Instead",
2162
+ enabled: false,
2163
+ parameters: []
2164
+ },
2165
+ {
2166
+ id: "shellcheck_SC2157",
2167
+ category: "ErrorProne",
2168
+ severityLevel: "Warning",
2169
+ title: "Avoid Argument to Implicit -n Being Always True Due to Literal Strings",
2170
+ enabled: false,
2171
+ parameters: []
2172
+ },
2173
+ {
2174
+ id: "shellcheck_SC2158",
2175
+ category: "ErrorProne",
2176
+ severityLevel: "High",
2177
+ title: "Avoid Using `[ false ]` Test Expression",
2178
+ enabled: false,
2179
+ parameters: []
2180
+ },
2181
+ {
2182
+ id: "shellcheck_SC2159",
2183
+ category: "ErrorProne",
2184
+ severityLevel: "Warning",
2185
+ title: "Avoid Using `[ 0 ]` for False Condition",
2186
+ enabled: false,
2187
+ parameters: []
2188
+ },
2189
+ {
2190
+ id: "shellcheck_SC2160",
2191
+ category: "CodeStyle",
2192
+ severityLevel: "Info",
2193
+ title: "Use `true` Instead of `[ true ]` in Conditionals",
2194
+ enabled: false,
2195
+ parameters: []
2196
+ },
2197
+ {
2198
+ id: "shellcheck_SC2161",
2199
+ category: "CodeStyle",
2200
+ severityLevel: "Info",
2201
+ title: "Use 'true' Instead of '[ 1 ]' for Always True Conditions",
2202
+ enabled: false,
2203
+ parameters: []
2204
+ },
2205
+ {
2206
+ id: "shellcheck_SC2162",
2207
+ category: "ErrorProne",
2208
+ severityLevel: "Warning",
2209
+ title: "Enforce use of read with -r to prevent backslash mangling",
2210
+ enabled: false,
2211
+ parameters: []
2212
+ },
2213
+ {
2214
+ id: "shellcheck_SC2163",
2215
+ category: "ErrorProne",
2216
+ severityLevel: "Warning",
2217
+ title: "Avoid Exporting Expanded Variables with export",
2218
+ enabled: false,
2219
+ parameters: []
2220
+ },
2221
+ {
2222
+ id: "shellcheck_SC2164",
2223
+ category: "ErrorProne",
2224
+ severityLevel: "High",
2225
+ title: "Enforce handling of `cd` command failure",
2226
+ enabled: false,
2227
+ parameters: []
2228
+ },
2229
+ {
2230
+ id: "shellcheck_SC2165",
2231
+ category: "ErrorProne",
2232
+ severityLevel: "High",
2233
+ title: "Avoid reusing index variable in nested loops",
2234
+ enabled: false,
2235
+ parameters: []
2236
+ },
2237
+ {
2238
+ id: "shellcheck_SC2166",
2239
+ category: "ErrorProne",
2240
+ severityLevel: "High",
2241
+ title: "Prefer [ p ] && [ q ] over [ p -a q ]",
2242
+ enabled: false,
2243
+ parameters: []
2244
+ },
2245
+ {
2246
+ id: "shellcheck_SC2167",
2247
+ category: "ErrorProne",
2248
+ severityLevel: "High",
2249
+ title: "Avoid Overriding Parent Loop Index Variable",
2250
+ enabled: false,
2251
+ parameters: []
2252
+ },
2253
+ {
2254
+ id: "shellcheck_SC2168",
2255
+ category: "ErrorProne",
2256
+ severityLevel: "High",
2257
+ title: "Avoid Using 'local' Outside Functions",
2258
+ enabled: false,
2259
+ parameters: []
2260
+ },
2261
+ {
2262
+ id: "shellcheck_SC2170",
2263
+ category: "ErrorProne",
2264
+ severityLevel: "High",
2265
+ title: "Avoid Invalid Number Usage with -eq; Use Proper String or Numeric Comparison",
2266
+ enabled: false,
2267
+ parameters: []
2268
+ },
2269
+ {
2270
+ id: "shellcheck_SC2171",
2271
+ category: "ErrorProne",
2272
+ severityLevel: "Warning",
2273
+ title: "Detect Trailing `]` Outside Test Expression",
2274
+ enabled: false,
2275
+ parameters: []
2276
+ },
2277
+ {
2278
+ id: "shellcheck_SC2172",
2279
+ category: "Compatibility",
2280
+ severityLevel: "Warning",
2281
+ title: "Prefer signal names over signal numbers in trap commands",
2282
+ enabled: false,
2283
+ parameters: []
2284
+ },
2285
+ {
2286
+ id: "shellcheck_SC2173",
2287
+ category: "ErrorProne",
2288
+ severityLevel: "High",
2289
+ title: "Avoid trapping SIGKILL and SIGSTOP signals",
2290
+ enabled: false,
2291
+ parameters: []
2292
+ },
2293
+ {
2294
+ id: "shellcheck_SC2174",
2295
+ category: "BestPractice",
2296
+ severityLevel: "Warning",
2297
+ title: "Avoid Using -m with -p in mkdir Because -m Only Applies to the Deepest Directory",
2298
+ enabled: false,
2299
+ parameters: []
2300
+ },
2301
+ {
2302
+ id: "shellcheck_SC2175",
2303
+ category: "ErrorProne",
2304
+ severityLevel: "Warning",
2305
+ title: "Quote Invalid Brace Expansion Passed to eval",
2306
+ enabled: false,
2307
+ parameters: []
2308
+ },
2309
+ {
2310
+ id: "shellcheck_SC2176",
2311
+ category: "ErrorProne",
2312
+ severityLevel: "Warning",
2313
+ title: "Avoid using `time` with pipelines",
2314
+ enabled: false,
2315
+ parameters: []
2316
+ },
2317
+ {
2318
+ id: "shellcheck_SC2177",
2319
+ category: "ErrorProne",
2320
+ severityLevel: "Warning",
2321
+ title: "Avoid using `time` with compound commands without `sh -c`",
2322
+ enabled: false,
2323
+ parameters: []
2324
+ },
2325
+ {
2326
+ id: "shellcheck_SC2178",
2327
+ category: "ErrorProne",
2328
+ severityLevel: "Warning",
2329
+ title: "Avoid Assigning String to Variable Previously Used as Array",
2330
+ enabled: false,
2331
+ parameters: []
2332
+ },
2333
+ {
2334
+ id: "shellcheck_SC2179",
2335
+ category: "ErrorProne",
2336
+ severityLevel: "Warning",
2337
+ title: "Use Proper Syntax to Append Items to an Array",
2338
+ enabled: false,
2339
+ parameters: []
2340
+ },
2341
+ {
2342
+ id: "shellcheck_SC2180",
2343
+ category: "ErrorProne",
2344
+ severityLevel: "High",
2345
+ title: "Avoid multidimensional arrays in Bash",
2346
+ enabled: false,
2347
+ parameters: []
2348
+ },
2349
+ {
2350
+ id: "shellcheck_SC2181",
2351
+ category: "BestPractice",
2352
+ severityLevel: "Warning",
2353
+ title: "Check exit code directly with if command, not with $?",
2354
+ enabled: false,
2355
+ parameters: []
2356
+ },
2357
+ {
2358
+ id: "shellcheck_SC2182",
2359
+ category: "ErrorProne",
2360
+ severityLevel: "High",
2361
+ title: "Avoid printf format strings without variables when passing additional arguments",
2362
+ enabled: false,
2363
+ parameters: []
2364
+ },
2365
+ {
2366
+ id: "shellcheck_SC2183",
2367
+ category: "ErrorProne",
2368
+ severityLevel: "Warning",
2369
+ title: "Ensure printf format string variables match argument count",
2370
+ enabled: false,
2371
+ parameters: []
2372
+ },
2373
+ {
2374
+ id: "shellcheck_SC2184",
2375
+ category: "ErrorProne",
2376
+ severityLevel: "High",
2377
+ title: "Quote Arguments to unset to Prevent Glob Expansion",
2378
+ enabled: false,
2379
+ parameters: []
2380
+ },
2381
+ {
2382
+ id: "shellcheck_SC2185",
2383
+ category: "Compatibility",
2384
+ severityLevel: "Warning",
2385
+ title: "Specify Default Path Explicitly in find Command",
2386
+ enabled: false,
2387
+ parameters: []
2388
+ },
2389
+ {
2390
+ id: "shellcheck_SC2186",
2391
+ category: "Compatibility",
2392
+ severityLevel: "Warning",
2393
+ title: "Avoid Using Deprecated tempfile; Use mktemp Instead",
2394
+ enabled: false,
2395
+ parameters: []
2396
+ },
2397
+ {
2398
+ id: "shellcheck_SC2187",
2399
+ category: "BestPractice",
2400
+ severityLevel: "Info",
2401
+ title: "Add ShellCheck Directive for Ash Scripts",
2402
+ enabled: false,
2403
+ parameters: []
2404
+ },
2405
+ {
2406
+ id: "shellcheck_SC2188",
2407
+ category: "ErrorProne",
2408
+ severityLevel: "Warning",
2409
+ title: "Avoid Redirection Without a Command",
2410
+ enabled: false,
2411
+ parameters: []
2412
+ },
2413
+ {
2414
+ id: "shellcheck_SC2189",
2415
+ category: "ErrorProne",
2416
+ severityLevel: "High",
2417
+ title: "Avoid Using Pipe Between Redirection and Command",
2418
+ enabled: false,
2419
+ parameters: []
2420
+ },
2421
+ {
2422
+ id: "shellcheck_SC2190",
2423
+ category: "ErrorProne",
2424
+ severityLevel: "High",
2425
+ title: "Enforce Explicit Indexing in Associative Arrays",
2426
+ enabled: false,
2427
+ parameters: []
2428
+ },
2429
+ {
2430
+ id: "shellcheck_SC2191",
2431
+ category: "ErrorProne",
2432
+ severityLevel: "Warning",
2433
+ title: "Enforce Correct Array Index Assignment Syntax",
2434
+ enabled: false,
2435
+ parameters: []
2436
+ },
2437
+ {
2438
+ id: "shellcheck_SC2192",
2439
+ category: "ErrorProne",
2440
+ severityLevel: "Warning",
2441
+ title: "Avoid Spaces After '=' in Array Element Assignments",
2442
+ enabled: false,
2443
+ parameters: []
2444
+ },
2445
+ {
2446
+ id: "shellcheck_SC2193",
2447
+ category: "ErrorProne",
2448
+ severityLevel: "High",
2449
+ title: "Avoid Comparing Arguments That Can Never Be Equal",
2450
+ enabled: false,
2451
+ parameters: []
2452
+ },
2453
+ {
2454
+ id: "shellcheck_SC2194",
2455
+ category: "ErrorProne",
2456
+ severityLevel: "High",
2457
+ title: "Detect Missing Variable Reference in Case Statement",
2458
+ enabled: false,
2459
+ parameters: []
2460
+ },
2461
+ {
2462
+ id: "shellcheck_SC2195",
2463
+ category: "ErrorProne",
2464
+ severityLevel: "High",
2465
+ title: "Avoid Patterns That Will Never Match in Case Statements",
2466
+ enabled: false,
2467
+ parameters: []
2468
+ },
2469
+ {
2470
+ id: "shellcheck_SC2196",
2471
+ category: "Compatibility",
2472
+ severityLevel: "Warning",
2473
+ title: "Avoid Using Deprecated `egrep` Command",
2474
+ enabled: false,
2475
+ parameters: []
2476
+ },
2477
+ {
2478
+ id: "shellcheck_SC2197",
2479
+ category: "Compatibility",
2480
+ severityLevel: "Warning",
2481
+ title: "Avoid using deprecated fgrep; use grep -F instead",
2482
+ enabled: false,
2483
+ parameters: []
2484
+ },
2485
+ {
2486
+ id: "shellcheck_SC2198",
2487
+ category: "ErrorProne",
2488
+ severityLevel: "High",
2489
+ title: "Avoid Using Arrays as Operands in [ ] Tests",
2490
+ enabled: false,
2491
+ parameters: []
2492
+ },
2493
+ {
2494
+ id: "shellcheck_SC2199",
2495
+ category: "ErrorProne",
2496
+ severityLevel: "Warning",
2497
+ title: "Avoid Implicit Array Concatenation in [[ ]] Tests",
2498
+ enabled: false,
2499
+ parameters: []
2500
+ },
2501
+ {
2502
+ id: "shellcheck_SC2200",
2503
+ category: "ErrorProne",
2504
+ severityLevel: "High",
2505
+ title: "Avoid Using Brace Expansions as Operands in [ ]",
2506
+ enabled: false,
2507
+ parameters: []
2508
+ },
2509
+ {
2510
+ id: "shellcheck_SC2201",
2511
+ category: "ErrorProne",
2512
+ severityLevel: "Warning",
2513
+ title: "Avoid Using Brace Expansion Inside [[ ]]",
2514
+ enabled: false,
2515
+ parameters: []
2516
+ },
2517
+ {
2518
+ id: "shellcheck_SC2202",
2519
+ category: "ErrorProne",
2520
+ severityLevel: "High",
2521
+ title: "Avoid Using Globs as Operands in [ ] Test Expressions",
2522
+ enabled: false,
2523
+ parameters: []
2524
+ },
2525
+ {
2526
+ id: "shellcheck_SC2203",
2527
+ category: "ErrorProne",
2528
+ severityLevel: "Warning",
2529
+ title: "Avoid Using Globs Directly in [[ ]] Tests",
2530
+ enabled: false,
2531
+ parameters: []
2532
+ },
2533
+ {
2534
+ id: "shellcheck_SC2204",
2535
+ category: "ErrorProne",
2536
+ severityLevel: "High",
2537
+ title: "Avoid Using Subshells Instead of Test Expressions",
2538
+ enabled: false,
2539
+ parameters: []
2540
+ },
2541
+ {
2542
+ id: "shellcheck_SC2205",
2543
+ category: "ErrorProne",
2544
+ severityLevel: "High",
2545
+ title: "Avoid Using Subshells Instead of Test Expressions",
2546
+ enabled: false,
2547
+ parameters: []
2548
+ },
2549
+ {
2550
+ id: "shellcheck_SC2206",
2551
+ category: "ErrorProne",
2552
+ severityLevel: "High",
2553
+ title: "Quote or Robustly Split Arrays to Prevent Word Splitting and Globbing",
2554
+ enabled: false,
2555
+ parameters: []
2556
+ },
2557
+ {
2558
+ id: "shellcheck_SC2207",
2559
+ category: "BestPractice",
2560
+ severityLevel: "Warning",
2561
+ title: "Prefer mapfile or read -a to split command output (or quote to avoid splitting)",
2562
+ enabled: false,
2563
+ parameters: []
2564
+ },
2565
+ {
2566
+ id: "shellcheck_SC2208",
2567
+ category: "ErrorProne",
2568
+ severityLevel: "High",
2569
+ title: "Avoid Unquoted Arguments to -v to Prevent Glob Expansion",
2570
+ enabled: false,
2571
+ parameters: []
2572
+ },
2573
+ {
2574
+ id: "shellcheck_SC2209",
2575
+ category: "ErrorProne",
2576
+ severityLevel: "Warning",
2577
+ title: "Use Command Substitution or Quoting for Variable Assignment",
2578
+ enabled: false,
2579
+ parameters: []
2580
+ },
2581
+ {
2582
+ id: "shellcheck_SC2210",
2583
+ category: "ErrorProne",
2584
+ severityLevel: "High",
2585
+ title: "Avoid Misinterpreted File Redirections",
2586
+ enabled: false,
2587
+ parameters: []
2588
+ },
2589
+ {
2590
+ id: "shellcheck_SC2211",
2591
+ category: "ErrorProne",
2592
+ severityLevel: "High",
2593
+ title: "Avoid Using Globs as Command Names",
2594
+ enabled: false,
2595
+ parameters: []
2596
+ },
2597
+ {
2598
+ id: "shellcheck_SC2212",
2599
+ category: "CodeStyle",
2600
+ severityLevel: "Info",
2601
+ title: "Use `false` Instead of Empty `[`/`[[` Conditionals",
2602
+ enabled: false,
2603
+ parameters: []
2604
+ },
2605
+ {
2606
+ id: "shellcheck_SC2213",
2607
+ category: "ErrorProne",
2608
+ severityLevel: "Warning",
2609
+ title: "Handle All getopts Flags in case Statement",
2610
+ enabled: false,
2611
+ parameters: []
2612
+ },
2613
+ {
2614
+ id: "shellcheck_SC2214",
2615
+ category: "ErrorProne",
2616
+ severityLevel: "Warning",
2617
+ title: "Ensure getopts Option String Matches Case Statements",
2618
+ enabled: false,
2619
+ parameters: []
2620
+ },
2621
+ {
2622
+ id: "shellcheck_SC2215",
2623
+ category: "ErrorProne",
2624
+ severityLevel: "High",
2625
+ title: "Avoid Using Flags as Command Names",
2626
+ enabled: false,
2627
+ parameters: []
2628
+ },
2629
+ {
2630
+ id: "shellcheck_SC2216",
2631
+ category: "ErrorProne",
2632
+ severityLevel: "High",
2633
+ title: "Avoid Piping to `rm` or Commands That Do Not Read from stdin",
2634
+ enabled: false,
2635
+ parameters: []
2636
+ },
2637
+ {
2638
+ id: "shellcheck_SC2217",
2639
+ category: "ErrorProne",
2640
+ severityLevel: "Warning",
2641
+ title: "Avoid Redirecting to echo Which Does Not Read stdin",
2642
+ enabled: false,
2643
+ parameters: []
2644
+ },
2645
+ {
2646
+ id: "shellcheck_SC2218",
2647
+ category: "ErrorProne",
2648
+ severityLevel: "High",
2649
+ title: "Move Function Definition Before Its First Call",
2650
+ enabled: false,
2651
+ parameters: []
2652
+ },
2653
+ {
2654
+ id: "shellcheck_SC2219",
2655
+ category: "BestPractice",
2656
+ severityLevel: "Info",
2657
+ title: "Prefer Arithmetic Compound Command (( expr )) over let expr",
2658
+ enabled: false,
2659
+ parameters: []
2660
+ },
2661
+ {
2662
+ id: "shellcheck_SC2220",
2663
+ category: "ErrorProne",
2664
+ severityLevel: "High",
2665
+ title: "Handle Invalid Flags in getopts with a Default Case",
2666
+ enabled: false,
2667
+ parameters: []
2668
+ },
2669
+ {
2670
+ id: "shellcheck_SC2221",
2671
+ category: "ErrorProne",
2672
+ severityLevel: "High",
2673
+ title: "Avoid Overriding Patterns in Case Statements",
2674
+ enabled: false,
2675
+ parameters: []
2676
+ },
2677
+ {
2678
+ id: "shellcheck_SC2222",
2679
+ category: "ErrorProne",
2680
+ severityLevel: "Warning",
2681
+ title: "Avoid Unreachable Pattern Due to Previous Pattern",
2682
+ enabled: false,
2683
+ parameters: []
2684
+ },
2685
+ {
2686
+ id: "shellcheck_SC2223",
2687
+ category: "BestPractice",
2688
+ severityLevel: "Warning",
2689
+ title: "Quote Default Assignment to Avoid Globbing",
2690
+ enabled: false,
2691
+ parameters: []
2692
+ },
2693
+ {
2694
+ id: "shellcheck_SC2224",
2695
+ category: "ErrorProne",
2696
+ severityLevel: "High",
2697
+ title: "Avoid mv Command Without Destination Argument",
2698
+ enabled: false,
2699
+ parameters: []
2700
+ },
2701
+ {
2702
+ id: "shellcheck_SC2225",
2703
+ category: "ErrorProne",
2704
+ severityLevel: "High",
2705
+ title: "Avoid cp Command Without Destination Argument",
2706
+ enabled: false,
2707
+ parameters: []
2708
+ },
2709
+ {
2710
+ id: "shellcheck_SC2226",
2711
+ category: "ErrorProne",
2712
+ severityLevel: "Warning",
2713
+ title: "Avoid ln Command Without Destination Argument",
2714
+ enabled: false,
2715
+ parameters: []
2716
+ },
2717
+ {
2718
+ id: "shellcheck_SC2227",
2719
+ category: "ErrorProne",
2720
+ severityLevel: "Warning",
2721
+ title: "Rewrite find Command Redirection to Apply Per Action",
2722
+ enabled: false,
2723
+ parameters: []
2724
+ },
2725
+ {
2726
+ id: "shellcheck_SC2229",
2727
+ category: "ErrorProne",
2728
+ severityLevel: "High",
2729
+ title: "Avoid Using Parameter Expansion with read Command Variable Argument",
2730
+ enabled: false,
2731
+ parameters: []
2732
+ },
2733
+ {
2734
+ id: "shellcheck_SC2230",
2735
+ category: "BestPractice",
2736
+ severityLevel: "Info",
2737
+ title: "Avoid using non-standard `which`; use builtin `command -v` instead",
2738
+ enabled: false,
2739
+ parameters: []
2740
+ },
2741
+ {
2742
+ id: "shellcheck_SC2231",
2743
+ category: "ErrorProne",
2744
+ severityLevel: "Warning",
2745
+ title: "Quote Expansions in For Loop Globs to Prevent Word Splitting",
2746
+ enabled: false,
2747
+ parameters: []
2748
+ },
2749
+ {
2750
+ id: "shellcheck_SC2232",
2751
+ category: "ErrorProne",
2752
+ severityLevel: "High",
2753
+ title: "Avoid using sudo with shell builtins like cd",
2754
+ enabled: false,
2755
+ parameters: []
2756
+ },
2757
+ {
2758
+ id: "shellcheck_SC2233",
2759
+ category: "Performance",
2760
+ severityLevel: "Warning",
2761
+ title: "Remove Superfluous Parentheses Around Condition",
2762
+ enabled: false,
2763
+ parameters: []
2764
+ },
2765
+ {
2766
+ id: "shellcheck_SC2234",
2767
+ category: "Performance",
2768
+ severityLevel: "Warning",
2769
+ title: "Remove Superfluous Subshell in Test Command",
2770
+ enabled: false,
2771
+ parameters: []
2772
+ },
2773
+ {
2774
+ id: "shellcheck_SC2235",
2775
+ category: "Performance",
2776
+ severityLevel: "Warning",
2777
+ title: "Avoid Using Subshells for Grouping Commands",
2778
+ enabled: false,
2779
+ parameters: []
2780
+ },
2781
+ {
2782
+ id: "shellcheck_SC2236",
2783
+ category: "CodeStyle",
2784
+ severityLevel: "Info",
2785
+ title: "Use '-n' Instead of '! -z'",
2786
+ enabled: false,
2787
+ parameters: []
2788
+ },
2789
+ {
2790
+ id: "shellcheck_SC2237",
2791
+ category: "CodeStyle",
2792
+ severityLevel: "Info",
2793
+ title: "Use `[ -n .. ]` Instead of `! [ -z .. ]` (and vice versa)",
2794
+ enabled: false,
2795
+ parameters: []
2796
+ },
2797
+ {
2798
+ id: "shellcheck_SC2238",
2799
+ category: "ErrorProne",
2800
+ severityLevel: "High",
2801
+ title: "Avoid Redirecting to/from Command Name Instead of File",
2802
+ enabled: false,
2803
+ parameters: []
2804
+ },
2805
+ {
2806
+ id: "shellcheck_SC2239",
2807
+ category: "ErrorProne",
2808
+ severityLevel: "Warning",
2809
+ title: "Ensure Shebang Uses Absolute Path to Interpreter",
2810
+ enabled: false,
2811
+ parameters: []
2812
+ },
2813
+ {
2814
+ id: "shellcheck_SC2240",
2815
+ category: "ErrorProne",
2816
+ severityLevel: "High",
2817
+ title: "Avoid Passing Arguments to the Dot Command in sh/dash",
2818
+ enabled: false,
2819
+ parameters: []
2820
+ },
2821
+ {
2822
+ id: "shellcheck_SC2241",
2823
+ category: "ErrorProne",
2824
+ severityLevel: "High",
2825
+ title: "Enforce Valid Exit Status Usage",
2826
+ enabled: false,
2827
+ parameters: []
2828
+ },
2829
+ {
2830
+ id: "shellcheck_SC2242",
2831
+ category: "ErrorProne",
2832
+ severityLevel: "High",
2833
+ title: "Enforce Valid Exit Status Codes (0-255)",
2834
+ enabled: false,
2835
+ parameters: []
2836
+ },
2837
+ {
2838
+ id: "shellcheck_SC2243",
2839
+ category: "BestPractice",
2840
+ severityLevel: "Info",
2841
+ title: "Prefer explicit -n to check for output or run command directly to check for success",
2842
+ enabled: false,
2843
+ parameters: []
2844
+ },
2845
+ {
2846
+ id: "shellcheck_SC2244",
2847
+ category: "BestPractice",
2848
+ severityLevel: "Info",
2849
+ title: "Prefer explicit '-n' to check non-empty string",
2850
+ enabled: false,
2851
+ parameters: []
2852
+ },
2853
+ {
2854
+ id: "shellcheck_SC2245",
2855
+ category: "ErrorProne",
2856
+ severityLevel: "Warning",
2857
+ title: "Avoid Using -d with Globs Without Loop in Shell Scripts",
2858
+ enabled: false,
2859
+ parameters: []
2860
+ },
2861
+ {
2862
+ id: "shellcheck_SC2246",
2863
+ category: "ErrorProne",
2864
+ severityLevel: "High",
2865
+ title: "Ensure Shebang Specifies an Interpreter File, Not a Directory",
2866
+ enabled: false,
2867
+ parameters: []
2868
+ },
2869
+ {
2870
+ id: "shellcheck_SC2247",
2871
+ category: "ErrorProne",
2872
+ severityLevel: "Warning",
2873
+ title: 'Flip Leading `$` and `"` for Quoted Substitution',
2874
+ enabled: false,
2875
+ parameters: []
2876
+ },
2877
+ {
2878
+ id: "shellcheck_SC2248",
2879
+ category: "BestPractice",
2880
+ severityLevel: "Info",
2881
+ title: "Prefer Double Quoting Variables Even Without Special Characters",
2882
+ enabled: false,
2883
+ parameters: []
2884
+ },
2885
+ {
2886
+ id: "shellcheck_SC2249",
2887
+ category: "BestPractice",
2888
+ severityLevel: "Warning",
2889
+ title: "Enforce default case in shell case statements",
2890
+ enabled: false,
2891
+ parameters: []
2892
+ },
2893
+ {
2894
+ id: "shellcheck_SC2250",
2895
+ category: "BestPractice",
2896
+ severityLevel: "Info",
2897
+ title: "Prefer Using Braces Around Variable References",
2898
+ enabled: false,
2899
+ parameters: []
2900
+ },
2901
+ {
2902
+ id: "shellcheck_SC2251",
2903
+ category: "ErrorProne",
2904
+ severityLevel: "High",
2905
+ title: "Ensure Proper Use of `!` with errexit in Shell Scripts",
2906
+ enabled: false,
2907
+ parameters: []
2908
+ },
2909
+ {
2910
+ id: "shellcheck_SC2252",
2911
+ category: "ErrorProne",
2912
+ severityLevel: "High",
2913
+ title: "Avoid Always True Condition by Using && Instead of ||",
2914
+ enabled: false,
2915
+ parameters: []
2916
+ },
2917
+ {
2918
+ id: "shellcheck_SC2253",
2919
+ category: "BestPractice",
2920
+ severityLevel: "Info",
2921
+ title: "Use Correct Flags for Recursive or Read Permission Changes in chmod",
2922
+ enabled: false,
2923
+ parameters: []
2924
+ },
2925
+ {
2926
+ id: "shellcheck_SC2254",
2927
+ category: "ErrorProne",
2928
+ severityLevel: "Warning",
2929
+ title: "Quote expansions in case patterns to match literally",
2930
+ enabled: false,
2931
+ parameters: []
2932
+ },
2933
+ {
2934
+ id: "shellcheck_SC2255",
2935
+ category: "ErrorProne",
2936
+ severityLevel: "High",
2937
+ title: "Enforce correct arithmetic evaluation in [ ] tests",
2938
+ enabled: false,
2939
+ parameters: []
2940
+ },
2941
+ {
2942
+ id: "shellcheck_SC2256",
2943
+ category: "BestPractice",
2944
+ severityLevel: "Warning",
2945
+ title: "Correct Quoted Variable Substitution",
2946
+ enabled: false,
2947
+ parameters: []
2948
+ },
2949
+ {
2950
+ id: "shellcheck_SC2257",
2951
+ category: "ErrorProne",
2952
+ severityLevel: "High",
2953
+ title: "Avoid Arithmetic Modifications in Command Redirections",
2954
+ enabled: false,
2955
+ parameters: []
2956
+ },
2957
+ {
2958
+ id: "shellcheck_SC2258",
2959
+ category: "ErrorProne",
2960
+ severityLevel: "Warning",
2961
+ title: "Avoid Trailing Commas in Shell For Loop Items",
2962
+ enabled: false,
2963
+ parameters: []
2964
+ },
2965
+ {
2966
+ id: "shellcheck_SC2259",
2967
+ category: "ErrorProne",
2968
+ severityLevel: "Warning",
2969
+ title: "Avoid Overriding Piped Input with Input Redirection",
2970
+ enabled: false,
2971
+ parameters: []
2972
+ },
2973
+ {
2974
+ id: "shellcheck_SC2260",
2975
+ category: "ErrorProne",
2976
+ severityLevel: "Warning",
2977
+ title: "Avoid Overriding Output Pipe with Redirection; Use tee to Output to Both",
2978
+ enabled: false,
2979
+ parameters: []
2980
+ },
2981
+ {
2982
+ id: "shellcheck_SC2261",
2983
+ category: "ErrorProne",
2984
+ severityLevel: "High",
2985
+ title: "Avoid Multiple Redirections Competing for stdout",
2986
+ enabled: false,
2987
+ parameters: []
2988
+ },
2989
+ {
2990
+ id: "shellcheck_SC2262",
2991
+ category: "ErrorProne",
2992
+ severityLevel: "Warning",
2993
+ title: "Avoid Defining and Using Aliases in the Same Parsing Unit",
2994
+ enabled: false,
2995
+ parameters: []
2996
+ },
2997
+ {
2998
+ id: "shellcheck_SC2263",
2999
+ category: "ErrorProne",
3000
+ severityLevel: "Warning",
3001
+ title: "Avoid Using Aliases in the Same Parsing Unit",
3002
+ enabled: false,
3003
+ parameters: []
3004
+ },
3005
+ {
3006
+ id: "shellcheck_SC2264",
3007
+ category: "ErrorProne",
3008
+ severityLevel: "High",
3009
+ title: "Avoid Unconditional Recursive Calls in Functions",
3010
+ enabled: false,
3011
+ parameters: []
3012
+ },
3013
+ {
3014
+ id: "shellcheck_SC2265",
3015
+ category: "ErrorProne",
3016
+ severityLevel: "High",
3017
+ title: "Use Logical AND (&&) Instead of Single Ampersand (&)",
3018
+ enabled: false,
3019
+ parameters: []
3020
+ },
3021
+ {
3022
+ id: "shellcheck_SC2266",
3023
+ category: "ErrorProne",
3024
+ severityLevel: "High",
3025
+ title: "Use logical OR (||) instead of single pipe (|) for conditionals",
3026
+ enabled: false,
3027
+ parameters: []
3028
+ },
3029
+ {
3030
+ id: "shellcheck_SC2267",
3031
+ category: "Compatibility",
3032
+ severityLevel: "Warning",
3033
+ title: "Avoid Deprecated GNU `xargs -i` Use `-I{}` Instead",
3034
+ enabled: false,
3035
+ parameters: []
3036
+ },
3037
+ {
3038
+ id: "shellcheck_SC2268",
3039
+ category: "BestPractice",
3040
+ severityLevel: "Info",
3041
+ title: "Avoid x-prefix in comparisons",
3042
+ enabled: false,
3043
+ parameters: []
3044
+ },
3045
+ {
3046
+ id: "shellcheck_SC2269",
3047
+ category: "ErrorProne",
3048
+ severityLevel: "Info",
3049
+ title: "Avoid Assigning a Variable to Itself",
3050
+ enabled: false,
3051
+ parameters: []
3052
+ },
3053
+ {
3054
+ id: "shellcheck_SC2270",
3055
+ category: "ErrorProne",
3056
+ severityLevel: "High",
3057
+ title: "Use `set --` to Assign Positional Parameters or `[ ]` for Comparison",
3058
+ enabled: false,
3059
+ parameters: []
3060
+ },
3061
+ {
3062
+ id: "shellcheck_SC2271",
3063
+ category: "ErrorProne",
3064
+ severityLevel: "High",
3065
+ title: "Use proper indirection methods instead of invalid variable name construction",
3066
+ enabled: false,
3067
+ parameters: []
3068
+ },
3069
+ {
3070
+ id: "shellcheck_SC2272",
3071
+ category: "ErrorProne",
3072
+ severityLevel: "High",
3073
+ title: "Avoid Using '==' in Command Names for Comparison",
3074
+ enabled: false,
3075
+ parameters: []
3076
+ },
3077
+ {
3078
+ id: "shellcheck_SC2273",
3079
+ category: "ErrorProne",
3080
+ severityLevel: "High",
3081
+ title: "Avoid Unresolved Sequence of === Markers",
3082
+ enabled: false,
3083
+ parameters: []
3084
+ },
3085
+ {
3086
+ id: "shellcheck_SC2274",
3087
+ category: "ErrorProne",
3088
+ severityLevel: "Warning",
3089
+ title: "Avoid Command Names Starting with === (Use Comments for Borders)",
3090
+ enabled: false,
3091
+ parameters: []
3092
+ },
3093
+ {
3094
+ id: "shellcheck_SC2275",
3095
+ category: "ErrorProne",
3096
+ severityLevel: "High",
3097
+ title: "Avoid Command Names Starting with '='",
3098
+ enabled: false,
3099
+ parameters: []
3100
+ },
3101
+ {
3102
+ id: "shellcheck_SC2276",
3103
+ category: "ErrorProne",
3104
+ severityLevel: "High",
3105
+ title: "Avoid Misinterpreted Equals Sign in Shell Commands",
3106
+ enabled: false,
3107
+ parameters: []
3108
+ },
3109
+ {
3110
+ id: "shellcheck_SC2277",
3111
+ category: "ErrorProne",
3112
+ severityLevel: "High",
3113
+ title: "Use BASH_ARGV0 to assign to $0 in Bash scripts",
3114
+ enabled: false,
3115
+ parameters: []
3116
+ },
3117
+ {
3118
+ id: "shellcheck_SC2278",
3119
+ category: "ErrorProne",
3120
+ severityLevel: "High",
3121
+ title: "Avoid Assigning to $0 in Ksh",
3122
+ enabled: false,
3123
+ parameters: []
3124
+ },
3125
+ {
3126
+ id: "shellcheck_SC2279",
3127
+ category: "ErrorProne",
3128
+ severityLevel: "High",
3129
+ title: "Avoid Assigning to $0 in Dash",
3130
+ enabled: false,
3131
+ parameters: []
3132
+ },
3133
+ {
3134
+ id: "shellcheck_SC2280",
3135
+ category: "ErrorProne",
3136
+ severityLevel: "High",
3137
+ title: "Avoid Assigning to $0 in Shell Scripts",
3138
+ enabled: false,
3139
+ parameters: []
3140
+ },
3141
+ {
3142
+ id: "shellcheck_SC2281",
3143
+ category: "ErrorProne",
3144
+ severityLevel: "High",
3145
+ title: "Avoid Using `$` or `${}` on the Left Side of Assignments",
3146
+ enabled: false,
3147
+ parameters: []
3148
+ },
3149
+ {
3150
+ id: "shellcheck_SC2282",
3151
+ category: "ErrorProne",
3152
+ severityLevel: "High",
3153
+ title: "Disallow Variable Names Starting with Numbers",
3154
+ enabled: false,
3155
+ parameters: []
3156
+ },
3157
+ {
3158
+ id: "shellcheck_SC2283",
3159
+ category: "ErrorProne",
3160
+ severityLevel: "High",
3161
+ title: "Use Correct Syntax for Assignment and Comparison in Shell Scripts",
3162
+ enabled: false,
3163
+ parameters: []
3164
+ },
3165
+ {
3166
+ id: "shellcheck_SC2284",
3167
+ category: "ErrorProne",
3168
+ severityLevel: "High",
3169
+ title: "Use Correct Syntax for Value Comparison in Shell",
3170
+ enabled: false,
3171
+ parameters: []
3172
+ },
3173
+ {
3174
+ id: "shellcheck_SC2285",
3175
+ category: "ErrorProne",
3176
+ severityLevel: "High",
3177
+ title: "Remove spaces around '+=' for variable assignment",
3178
+ enabled: false,
3179
+ parameters: []
3180
+ },
3181
+ {
3182
+ id: "shellcheck_SC2286",
3183
+ category: "ErrorProne",
3184
+ severityLevel: "High",
3185
+ title: "Avoid Empty String as Command Name",
3186
+ enabled: false,
3187
+ parameters: []
3188
+ },
3189
+ {
3190
+ id: "shellcheck_SC2287",
3191
+ category: "ErrorProne",
3192
+ severityLevel: "High",
3193
+ title: "Avoid Command Names Ending with '/'",
3194
+ enabled: false,
3195
+ parameters: []
3196
+ },
3197
+ {
3198
+ id: "shellcheck_SC2288",
3199
+ category: "ErrorProne",
3200
+ severityLevel: "High",
3201
+ title: "Avoid Command Names Ending with Apostrophe or Similar Symbols",
3202
+ enabled: false,
3203
+ parameters: []
3204
+ },
3205
+ {
3206
+ id: "shellcheck_SC2289",
3207
+ category: "ErrorProne",
3208
+ severityLevel: "High",
3209
+ title: "Avoid Command Names Containing Linefeeds or Tabs",
3210
+ enabled: false,
3211
+ parameters: []
3212
+ },
3213
+ {
3214
+ id: "shellcheck_SC2290",
3215
+ category: "ErrorProne",
3216
+ severityLevel: "High",
3217
+ title: "Remove Spaces Around '=' in Variable Assignments",
3218
+ enabled: false,
3219
+ parameters: []
3220
+ },
3221
+ {
3222
+ id: "shellcheck_SC2291",
3223
+ category: "BestPractice",
3224
+ severityLevel: "Info",
3225
+ title: "Quote repeated spaces to preserve spacing in echo",
3226
+ enabled: false,
3227
+ parameters: []
3228
+ },
3229
+ {
3230
+ id: "shellcheck_SC2292",
3231
+ category: "BestPractice",
3232
+ severityLevel: "Info",
3233
+ title: "Prefer [[ ]] over [ ] for tests in Bash/Ksh",
3234
+ enabled: false,
3235
+ parameters: []
3236
+ },
3237
+ {
3238
+ id: "shellcheck_SC2293",
3239
+ category: "ErrorProne",
3240
+ severityLevel: "High",
3241
+ title: "Use * Instead of @ When Eval'ing @Q-Quoted Words",
3242
+ enabled: false,
3243
+ parameters: []
3244
+ },
3245
+ {
3246
+ id: "shellcheck_SC2294",
3247
+ category: "ErrorProne",
3248
+ severityLevel: "High",
3249
+ title: "Avoid Using eval on Arrays to Preserve Whitespace and Symbols",
3250
+ enabled: false,
3251
+ parameters: []
3252
+ },
3253
+ {
3254
+ id: "shellcheck_SC2295",
3255
+ category: "ErrorProne",
3256
+ severityLevel: "Warning",
3257
+ title: "Quote Expansions Inside Parameter Expansion Separately",
3258
+ enabled: false,
3259
+ parameters: []
3260
+ },
3261
+ {
3262
+ id: "shellcheck_SC2296",
3263
+ category: "ErrorProne",
3264
+ severityLevel: "High",
3265
+ title: "Avoid Parameter Expansions Starting with Invalid Characters",
3266
+ enabled: false,
3267
+ parameters: []
3268
+ },
3269
+ {
3270
+ id: "shellcheck_SC2297",
3271
+ category: "ErrorProne",
3272
+ severityLevel: "High",
3273
+ title: "Enforce Double Quotes Outside Parameter Expansion Braces",
3274
+ enabled: false,
3275
+ parameters: []
3276
+ },
3277
+ {
3278
+ id: "shellcheck_SC2298",
3279
+ category: "ErrorProne",
3280
+ severityLevel: "High",
3281
+ title: "Avoid Invalid Parameter Expansion Using `${$x}`",
3282
+ enabled: false,
3283
+ parameters: []
3284
+ },
3285
+ {
3286
+ id: "shellcheck_SC2299",
3287
+ category: "ErrorProne",
3288
+ severityLevel: "Warning",
3289
+ title: "Avoid Nested Parameter Expansions; Use Temporary Variables",
3290
+ enabled: false,
3291
+ parameters: []
3292
+ },
3293
+ {
3294
+ id: "shellcheck_SC2300",
3295
+ category: "ErrorProne",
3296
+ severityLevel: "High",
3297
+ title: "Avoid Parameter Expansion on Command Substitutions",
3298
+ enabled: false,
3299
+ parameters: []
3300
+ },
3301
+ {
3302
+ id: "shellcheck_SC2301",
3303
+ category: "ErrorProne",
3304
+ severityLevel: "Warning",
3305
+ title: "Avoid Parameter Expansion Starting with Unexpected Quotes",
3306
+ enabled: false,
3307
+ parameters: []
3308
+ },
3309
+ {
3310
+ id: "shellcheck_SC2302",
3311
+ category: "ErrorProne",
3312
+ severityLevel: "High",
3313
+ title: "Avoid Using Array Values as Keys in Loops",
3314
+ enabled: false,
3315
+ parameters: []
3316
+ },
3317
+ {
3318
+ id: "shellcheck_SC2303",
3319
+ category: "ErrorProne",
3320
+ severityLevel: "Warning",
3321
+ title: "Avoid Using Array Values as Keys; Use Values Directly or Loop Over Keys",
3322
+ enabled: false,
3323
+ parameters: []
3324
+ },
3325
+ {
3326
+ id: "shellcheck_SC2304",
3327
+ category: "ErrorProne",
3328
+ severityLevel: "High",
3329
+ title: "Escape Asterisk or Use Arithmetic Expansion for Multiplication",
3330
+ enabled: false,
3331
+ parameters: []
3332
+ },
3333
+ {
3334
+ id: "shellcheck_SC2305",
3335
+ category: "ErrorProne",
3336
+ severityLevel: "High",
3337
+ title: "Quote regex argument to expr to avoid glob expansion",
3338
+ enabled: false,
3339
+ parameters: []
3340
+ },
3341
+ {
3342
+ id: "shellcheck_SC2306",
3343
+ category: "ErrorProne",
3344
+ severityLevel: "Warning",
3345
+ title: "Escape glob characters in arguments to expr",
3346
+ enabled: false,
3347
+ parameters: []
3348
+ },
3349
+ {
3350
+ id: "shellcheck_SC2307",
3351
+ category: "ErrorProne",
3352
+ severityLevel: "High",
3353
+ title: "Enforce Correct Argument Usage in expr Command",
3354
+ enabled: false,
3355
+ parameters: []
3356
+ },
3357
+ {
3358
+ id: "shellcheck_SC2308",
3359
+ category: "Compatibility",
3360
+ severityLevel: "High",
3361
+ title: "Avoid Using expr length, match, index, and substr; Prefer Parameter Expansion",
3362
+ enabled: false,
3363
+ parameters: []
3364
+ },
3365
+ {
3366
+ id: "shellcheck_SC2309",
3367
+ category: "ErrorProne",
3368
+ severityLevel: "High",
3369
+ title: "Avoid Using -eq for String Comparison",
3370
+ enabled: false,
3371
+ parameters: []
3372
+ },
3373
+ {
3374
+ id: "shellcheck_SC2310",
3375
+ category: "ErrorProne",
3376
+ severityLevel: "High",
3377
+ title: "Avoid Invoking Functions in 'if' Conditions When Using set -e",
3378
+ enabled: false,
3379
+ parameters: []
3380
+ },
3381
+ {
3382
+ id: "shellcheck_SC2311",
3383
+ category: "ErrorProne",
3384
+ severityLevel: "High",
3385
+ title: "Enforce set -e in Bash functions inside command substitutions",
3386
+ enabled: false,
3387
+ parameters: []
3388
+ },
3389
+ {
3390
+ id: "shellcheck_SC2312",
3391
+ category: "ErrorProne",
3392
+ severityLevel: "High",
3393
+ title: "Avoid Masking Return Values by Command Substitution",
3394
+ enabled: false,
3395
+ parameters: []
3396
+ },
3397
+ {
3398
+ id: "shellcheck_SC2313",
3399
+ category: "ErrorProne",
3400
+ severityLevel: "High",
3401
+ title: "Quote Array Indices to Avoid Globbing Expansion",
3402
+ enabled: false,
3403
+ parameters: []
3404
+ },
3405
+ {
3406
+ id: "shellcheck_SC2314",
3407
+ category: "ErrorProne",
3408
+ severityLevel: "High",
3409
+ title: "Avoid Using `!` Outside `run` in Bats Tests",
3410
+ enabled: false,
3411
+ parameters: []
3412
+ },
3413
+ {
3414
+ id: "shellcheck_SC2315",
3415
+ category: "ErrorProne",
3416
+ severityLevel: "High",
3417
+ title: "Fold Negation Into Conditional in Bats Tests",
3418
+ enabled: false,
3419
+ parameters: []
3420
+ },
3421
+ {
3422
+ id: "shellcheck_SC2316",
3423
+ category: "ErrorProne",
3424
+ severityLevel: "Warning",
3425
+ title: "Avoid Applying 'local' to 'readonly' Variables Incorrectly",
3426
+ enabled: false,
3427
+ parameters: []
3428
+ },
3429
+ {
3430
+ id: "shellcheck_SC2317",
3431
+ category: "ErrorProne",
3432
+ severityLevel: "Warning",
3433
+ title: "Avoid Unreachable Commands",
3434
+ enabled: false,
3435
+ parameters: []
3436
+ },
3437
+ {
3438
+ id: "shellcheck_SC2318",
3439
+ category: "ErrorProne",
3440
+ severityLevel: "Warning",
3441
+ title: "Avoid Multiple Assignments in a Single declare Command",
3442
+ enabled: false,
3443
+ parameters: []
3444
+ },
3445
+ {
3446
+ id: "shellcheck_SC2319",
3447
+ category: "ErrorProne",
3448
+ severityLevel: "High",
3449
+ title: "Avoid Overwriting $? by Assigning It to a Variable",
3450
+ enabled: false,
3451
+ parameters: []
3452
+ },
3453
+ {
3454
+ id: "shellcheck_SC2320",
3455
+ category: "ErrorProne",
3456
+ severityLevel: "High",
3457
+ title: "Avoid Using $? After echo/printf Without Saving It",
3458
+ enabled: false,
3459
+ parameters: []
3460
+ },
3461
+ {
3462
+ id: "shellcheck_SC2321",
3463
+ category: "CodeStyle",
3464
+ severityLevel: "Info",
3465
+ title: "Avoid Redundant Arithmetic Expansion in Array Indices",
3466
+ enabled: false,
3467
+ parameters: []
3468
+ },
3469
+ {
3470
+ id: "shellcheck_SC2322",
3471
+ category: "CodeStyle",
3472
+ severityLevel: "Info",
3473
+ title: "Prefer Single Layer of Parentheses in Arithmetic Expressions",
3474
+ enabled: false,
3475
+ parameters: []
3476
+ },
3477
+ {
3478
+ id: "shellcheck_SC2323",
3479
+ category: "CodeStyle",
3480
+ severityLevel: "Info",
3481
+ title: "Avoid Redundant Parentheses in Shell Arithmetic Expressions",
3482
+ enabled: false,
3483
+ parameters: []
3484
+ },
3485
+ {
3486
+ id: "shellcheck_SC2324",
3487
+ category: "ErrorProne",
3488
+ severityLevel: "High",
3489
+ title: "Avoid Using var+=1 to Increment Variables in Shell Scripts",
3490
+ enabled: false,
3491
+ parameters: []
3492
+ },
3493
+ {
3494
+ id: "shellcheck_SC2325",
3495
+ category: "Compatibility",
3496
+ severityLevel: "Warning",
3497
+ title: "Avoid Multiple Negations (!) in Front of Pipelines",
3498
+ enabled: false,
3499
+ parameters: []
3500
+ },
3501
+ {
3502
+ id: "shellcheck_SC2326",
3503
+ category: "ErrorProne",
3504
+ severityLevel: "High",
3505
+ title: "Disallow '!' Negation in the Middle of Pipelines",
3506
+ enabled: false,
3507
+ parameters: []
3508
+ },
3509
+ {
3510
+ id: "shellcheck_SC3001",
3511
+ category: "Compatibility",
3512
+ severityLevel: "High",
3513
+ title: "Avoid Process Substitution in POSIX sh",
3514
+ enabled: false,
3515
+ parameters: []
3516
+ },
3517
+ {
3518
+ id: "shellcheck_SC3002",
3519
+ category: "Compatibility",
3520
+ severityLevel: "Warning",
3521
+ title: "Avoid Using extglob in POSIX sh",
3522
+ enabled: false,
3523
+ parameters: []
3524
+ },
3525
+ {
3526
+ id: "shellcheck_SC3003",
3527
+ category: "Compatibility",
3528
+ severityLevel: "High",
3529
+ title: "Avoid Using Bash-specific ANSI-C Quoting in POSIX sh",
3530
+ enabled: false,
3531
+ parameters: []
3532
+ },
3533
+ {
3534
+ id: "shellcheck_SC3004",
3535
+ category: "Compatibility",
3536
+ severityLevel: "Warning",
3537
+ title: 'Avoid Using $".." in POSIX sh',
3538
+ enabled: false,
3539
+ parameters: []
3540
+ },
3541
+ {
3542
+ id: "shellcheck_SC3005",
3543
+ category: "Compatibility",
3544
+ severityLevel: "High",
3545
+ title: "Avoid Using Arithmetic For Loops in POSIX sh",
3546
+ enabled: false,
3547
+ parameters: []
3548
+ },
3549
+ {
3550
+ id: "shellcheck_SC3006",
3551
+ category: "Compatibility",
3552
+ severityLevel: "Warning",
3553
+ title: "Avoid using standalone ((..)) in POSIX sh",
3554
+ enabled: false,
3555
+ parameters: []
3556
+ },
3557
+ {
3558
+ id: "shellcheck_SC3007",
3559
+ category: "Compatibility",
3560
+ severityLevel: "High",
3561
+ title: "Avoid Using $[..] Instead of POSIX Standard Arithmetic Expansion $((..))",
3562
+ enabled: false,
3563
+ parameters: []
3564
+ },
3565
+ {
3566
+ id: "shellcheck_SC3008",
3567
+ category: "Compatibility",
3568
+ severityLevel: "Warning",
3569
+ title: "Avoid select loops in POSIX sh",
3570
+ enabled: false,
3571
+ parameters: []
3572
+ },
3573
+ {
3574
+ id: "shellcheck_SC3009",
3575
+ category: "ErrorProne",
3576
+ severityLevel: "High",
3577
+ title: "Avoid Brace Expansion in POSIX sh",
3578
+ enabled: false,
3579
+ parameters: []
3580
+ },
3581
+ {
3582
+ id: "shellcheck_SC3010",
3583
+ category: "Compatibility",
3584
+ severityLevel: "High",
3585
+ title: "Avoid Using [[ ]] in POSIX sh",
3586
+ enabled: false,
3587
+ parameters: []
3588
+ },
3589
+ {
3590
+ id: "shellcheck_SC3011",
3591
+ category: "Compatibility",
3592
+ severityLevel: "Warning",
3593
+ title: "Avoid Here-Strings in POSIX sh",
3594
+ enabled: false,
3595
+ parameters: []
3596
+ },
3597
+ {
3598
+ id: "shellcheck_SC3012",
3599
+ category: "Compatibility",
3600
+ severityLevel: "Warning",
3601
+ title: "Avoid Using Lexicographical \\< Operator in POSIX sh",
3602
+ enabled: false,
3603
+ parameters: []
3604
+ },
3605
+ {
3606
+ id: "shellcheck_SC3013",
3607
+ category: "Compatibility",
3608
+ severityLevel: "Warning",
3609
+ title: "Avoid Using `-nt` in POSIX sh",
3610
+ enabled: false,
3611
+ parameters: []
3612
+ },
3613
+ {
3614
+ id: "shellcheck_SC3014",
3615
+ category: "Compatibility",
3616
+ severityLevel: "High",
3617
+ title: "Avoid using '==' for string comparison in POSIX sh",
3618
+ enabled: false,
3619
+ parameters: []
3620
+ },
3621
+ {
3622
+ id: "shellcheck_SC3015",
3623
+ category: "Compatibility",
3624
+ severityLevel: "Warning",
3625
+ title: "Avoid Using =~ Regex Matching in POSIX sh",
3626
+ enabled: false,
3627
+ parameters: []
3628
+ },
3629
+ {
3630
+ id: "shellcheck_SC3016",
3631
+ category: "Compatibility",
3632
+ severityLevel: "Warning",
3633
+ title: "Avoid Using Unary -v in POSIX sh",
3634
+ enabled: false,
3635
+ parameters: []
3636
+ },
3637
+ {
3638
+ id: "shellcheck_SC3017",
3639
+ category: "Compatibility",
3640
+ severityLevel: "Warning",
3641
+ title: "Avoid Using Unary -a for File Existence in POSIX sh",
3642
+ enabled: false,
3643
+ parameters: []
3644
+ },
3645
+ {
3646
+ id: "shellcheck_SC3018",
3647
+ category: "Compatibility",
3648
+ severityLevel: "High",
3649
+ title: "Avoid Using Unsupported Increment Operators in POSIX sh",
3650
+ enabled: false,
3651
+ parameters: []
3652
+ },
3653
+ {
3654
+ id: "shellcheck_SC3019",
3655
+ category: "Compatibility",
3656
+ severityLevel: "High",
3657
+ title: "Avoid Using Exponentials with '**' in POSIX sh",
3658
+ enabled: false,
3659
+ parameters: []
3660
+ },
3661
+ {
3662
+ id: "shellcheck_SC3020",
3663
+ category: "Compatibility",
3664
+ severityLevel: "High",
3665
+ title: "Avoid Using `&>` Redirection in POSIX sh",
3666
+ enabled: false,
3667
+ parameters: []
3668
+ },
3669
+ {
3670
+ id: "shellcheck_SC3021",
3671
+ category: "Compatibility",
3672
+ severityLevel: "Warning",
3673
+ title: "Avoid Using Bash-Specific `>& filename` Redirection in POSIX sh",
3674
+ enabled: false,
3675
+ parameters: []
3676
+ },
3677
+ {
3678
+ id: "shellcheck_SC3022",
3679
+ category: "Compatibility",
3680
+ severityLevel: "High",
3681
+ title: "Avoid Named File Descriptors in POSIX sh",
3682
+ enabled: false,
3683
+ parameters: []
3684
+ },
3685
+ {
3686
+ id: "shellcheck_SC3023",
3687
+ category: "Compatibility",
3688
+ severityLevel: "High",
3689
+ title: "Avoid Using File Descriptors Outside 0-9 in POSIX sh",
3690
+ enabled: false,
3691
+ parameters: []
3692
+ },
3693
+ {
3694
+ id: "shellcheck_SC3024",
3695
+ category: "Compatibility",
3696
+ severityLevel: "Warning",
3697
+ title: "Avoid Using '+=' in POSIX sh",
3698
+ enabled: false,
3699
+ parameters: []
3700
+ },
3701
+ {
3702
+ id: "shellcheck_SC3025",
3703
+ category: "Compatibility",
3704
+ severityLevel: "Warning",
3705
+ title: "Avoid Using /dev/tcp and /dev/udp in POSIX sh",
3706
+ enabled: false,
3707
+ parameters: []
3708
+ },
3709
+ {
3710
+ id: "shellcheck_SC3026",
3711
+ category: "Compatibility",
3712
+ severityLevel: "Warning",
3713
+ title: "Avoid Using `^` for Negation in POSIX Shell Globs",
3714
+ enabled: false,
3715
+ parameters: []
3716
+ },
3717
+ {
3718
+ id: "shellcheck_SC3028",
3719
+ category: "Compatibility",
3720
+ severityLevel: "Warning",
3721
+ title: "Avoid Using Undefined Special Variables in POSIX sh",
3722
+ enabled: false,
3723
+ parameters: []
3724
+ },
3725
+ {
3726
+ id: "shellcheck_SC3029",
3727
+ category: "Compatibility",
3728
+ severityLevel: "Warning",
3729
+ title: "Avoid Using `|&` in POSIX sh Scripts",
3730
+ enabled: false,
3731
+ parameters: []
3732
+ },
3733
+ {
3734
+ id: "shellcheck_SC3030",
3735
+ category: "ErrorProne",
3736
+ severityLevel: "High",
3737
+ title: "Avoid Using Arrays in POSIX sh",
3738
+ enabled: false,
3739
+ parameters: []
3740
+ },
3741
+ {
3742
+ id: "shellcheck_SC3031",
3743
+ category: "Compatibility",
3744
+ severityLevel: "Warning",
3745
+ title: "Avoid Redirecting From/To Globs in POSIX sh",
3746
+ enabled: false,
3747
+ parameters: []
3748
+ },
3749
+ {
3750
+ id: "shellcheck_SC3032",
3751
+ category: "Compatibility",
3752
+ severityLevel: "High",
3753
+ title: "Avoid Using 'coproc' in POSIX sh Scripts",
3754
+ enabled: false,
3755
+ parameters: []
3756
+ },
3757
+ {
3758
+ id: "shellcheck_SC3033",
3759
+ category: "Compatibility",
3760
+ severityLevel: "High",
3761
+ title: "Enforce POSIX-compliant Function Names in Shell Scripts",
3762
+ enabled: false,
3763
+ parameters: []
3764
+ },
3765
+ {
3766
+ id: "shellcheck_SC3034",
3767
+ category: "Compatibility",
3768
+ severityLevel: "High",
3769
+ title: "Avoid Using '$(<file)' in POSIX sh",
3770
+ enabled: false,
3771
+ parameters: []
3772
+ },
3773
+ {
3774
+ id: "shellcheck_SC3035",
3775
+ category: "Compatibility",
3776
+ severityLevel: "Warning",
3777
+ title: "Avoid Using `<file` Redirection in POSIX sh",
3778
+ enabled: false,
3779
+ parameters: []
3780
+ },
3781
+ {
3782
+ id: "shellcheck_SC3036",
3783
+ category: "Compatibility",
3784
+ severityLevel: "Warning",
3785
+ title: "Avoid Unsupported Echo Flags in Dash",
3786
+ enabled: false,
3787
+ parameters: []
3788
+ },
3789
+ {
3790
+ id: "shellcheck_SC3037",
3791
+ category: "Compatibility",
3792
+ severityLevel: "Warning",
3793
+ title: "Avoid Using Echo Flags in POSIX sh",
3794
+ enabled: false,
3795
+ parameters: []
3796
+ },
3797
+ {
3798
+ id: "shellcheck_SC3038",
3799
+ category: "Compatibility",
3800
+ severityLevel: "Warning",
3801
+ title: "Avoid Using exec Flags in POSIX sh",
3802
+ enabled: false,
3803
+ parameters: []
3804
+ },
3805
+ {
3806
+ id: "shellcheck_SC3039",
3807
+ category: "Compatibility",
3808
+ severityLevel: "High",
3809
+ title: "Avoid Using 'let' in POSIX sh",
3810
+ enabled: false,
3811
+ parameters: []
3812
+ },
3813
+ {
3814
+ id: "shellcheck_SC3040",
3815
+ category: "Compatibility",
3816
+ severityLevel: "High",
3817
+ title: "Avoid Using Undefined set Option in POSIX sh",
3818
+ enabled: false,
3819
+ parameters: []
3820
+ },
3821
+ {
3822
+ id: "shellcheck_SC3041",
3823
+ category: "Compatibility",
3824
+ severityLevel: "High",
3825
+ title: "Avoid Using Undefined Set Flags in POSIX sh",
3826
+ enabled: false,
3827
+ parameters: []
3828
+ },
3829
+ {
3830
+ id: "shellcheck_SC3042",
3831
+ category: "Compatibility",
3832
+ severityLevel: "Warning",
3833
+ title: "Avoid Using Unsupported set Flags in POSIX sh",
3834
+ enabled: false,
3835
+ parameters: []
3836
+ },
3837
+ {
3838
+ id: "shellcheck_SC3043",
3839
+ category: "Compatibility",
3840
+ severityLevel: "Warning",
3841
+ title: "Avoid Using 'local' in POSIX sh",
3842
+ enabled: false,
3843
+ parameters: []
3844
+ },
3845
+ {
3846
+ id: "shellcheck_SC3044",
3847
+ category: "Compatibility",
3848
+ severityLevel: "High",
3849
+ title: "Avoid Using `declare` in POSIX sh",
3850
+ enabled: false,
3851
+ parameters: []
3852
+ },
3853
+ {
3854
+ id: "shellcheck_SC3045",
3855
+ category: "Compatibility",
3856
+ severityLevel: "High",
3857
+ title: "Avoid Using Unsupported Command Flags in POSIX sh",
3858
+ enabled: false,
3859
+ parameters: []
3860
+ },
3861
+ {
3862
+ id: "shellcheck_SC3046",
3863
+ category: "Compatibility",
3864
+ severityLevel: "High",
3865
+ title: "Avoid Using 'source' Instead of '.' in POSIX sh",
3866
+ enabled: false,
3867
+ parameters: []
3868
+ },
3869
+ {
3870
+ id: "shellcheck_SC3047",
3871
+ category: "Compatibility",
3872
+ severityLevel: "High",
3873
+ title: "Avoid trapping ERR in POSIX sh",
3874
+ enabled: false,
3875
+ parameters: []
3876
+ },
3877
+ {
3878
+ id: "shellcheck_SC3048",
3879
+ category: "Compatibility",
3880
+ severityLevel: "Warning",
3881
+ title: "Avoid prefixing signal names with 'SIG' in POSIX sh",
3882
+ enabled: false,
3883
+ parameters: []
3884
+ },
3885
+ {
3886
+ id: "shellcheck_SC3049",
3887
+ category: "Compatibility",
3888
+ severityLevel: "Warning",
3889
+ title: "Enforce Uppercase Signal Names in POSIX sh",
3890
+ enabled: false,
3891
+ parameters: []
3892
+ },
3893
+ {
3894
+ id: "shellcheck_SC3050",
3895
+ category: "Compatibility",
3896
+ severityLevel: "Warning",
3897
+ title: "Avoid Using printf %q in POSIX sh",
3898
+ enabled: false,
3899
+ parameters: []
3900
+ },
3901
+ {
3902
+ id: "shellcheck_SC3051",
3903
+ category: "Compatibility",
3904
+ severityLevel: "Warning",
3905
+ title: "Avoid using 'source' in POSIX sh; use '.' instead",
3906
+ enabled: false,
3907
+ parameters: []
3908
+ },
3909
+ {
3910
+ id: "shellcheck_SC3052",
3911
+ category: "Compatibility",
3912
+ severityLevel: "Warning",
3913
+ title: "Avoid Arithmetic Base Conversion in POSIX sh",
3914
+ enabled: false,
3915
+ parameters: []
3916
+ },
3917
+ {
3918
+ id: "shellcheck_SC3053",
3919
+ category: "Compatibility",
3920
+ severityLevel: "High",
3921
+ title: "Avoid Indirect Expansion in POSIX sh",
3922
+ enabled: false,
3923
+ parameters: []
3924
+ },
3925
+ {
3926
+ id: "shellcheck_SC3054",
3927
+ category: "Compatibility",
3928
+ severityLevel: "High",
3929
+ title: "Avoid Array References in POSIX sh",
3930
+ enabled: false,
3931
+ parameters: []
3932
+ },
3933
+ {
3934
+ id: "shellcheck_SC3055",
3935
+ category: "ErrorProne",
3936
+ severityLevel: "High",
3937
+ title: "Avoid Array Key Expansion in POSIX sh",
3938
+ enabled: false,
3939
+ parameters: []
3940
+ },
3941
+ {
3942
+ id: "shellcheck_SC3056",
3943
+ category: "Compatibility",
3944
+ severityLevel: "High",
3945
+ title: "Avoid Using Name Matching Prefixes in POSIX sh",
3946
+ enabled: false,
3947
+ parameters: []
3948
+ },
3949
+ {
3950
+ id: "shellcheck_SC3057",
3951
+ category: "Compatibility",
3952
+ severityLevel: "High",
3953
+ title: "Avoid Using String Indexing in POSIX sh",
3954
+ enabled: false,
3955
+ parameters: []
3956
+ },
3957
+ {
3958
+ id: "shellcheck_SC3059",
3959
+ category: "Compatibility",
3960
+ severityLevel: "Warning",
3961
+ title: "Avoid Case Modification in Shell Scripts for POSIX Compatibility",
3962
+ enabled: false,
3963
+ parameters: []
3964
+ },
3965
+ {
3966
+ id: "shellcheck_SC3060",
3967
+ category: "Compatibility",
3968
+ severityLevel: "High",
3969
+ title: "Avoid Using String Replacement in POSIX sh",
3970
+ enabled: false,
3971
+ parameters: []
3972
+ }
3973
+ ];
3974
+
3975
+ // src/adapter.ts
3976
+ var TOOL_ID = "shellcheck";
3977
+ var PATTERN_META = new Map(
3978
+ patterns_default.map((p) => [
3979
+ p.id,
3980
+ {
3981
+ category: p.category,
3982
+ severity: p.severityLevel ?? "Info"
3983
+ }
3984
+ ])
3985
+ );
3986
+ function ruleMetadata(code) {
3987
+ const patternId = `${TOOL_ID}_SC${code}`;
3988
+ return PATTERN_META.get(patternId) ?? { category: "ErrorProne", severity: "Info" };
3989
+ }
3990
+ function getLineContent(lines, lineNumber) {
3991
+ return lines[lineNumber - 1] ?? "";
3992
+ }
3993
+ async function readFileLines(filePath) {
3994
+ try {
3995
+ const content = await import_promises.default.readFile(filePath, "utf-8");
3996
+ return content.split("\n");
3997
+ } catch {
3998
+ return [];
3999
+ }
4000
+ }
4001
+ function buildResult(startedAt, completedAt, issues, errors, filesAnalyzed) {
4002
+ const durationMs = completedAt.getTime() - startedAt.getTime();
4003
+ return {
4004
+ metadata: {
4005
+ startedAt: startedAt.toISOString(),
4006
+ completedAt: completedAt.toISOString(),
4007
+ durationMs
4008
+ },
4009
+ issues,
4010
+ errors,
4011
+ summary: {
4012
+ toolId: TOOL_ID,
4013
+ status: errors.some((e) => e.level === "error") ? "partial" : "success",
4014
+ issueCount: issues.length,
4015
+ errorCount: errors.length,
4016
+ durationMs,
4017
+ filesAnalyzed
4018
+ }
4019
+ };
4020
+ }
4021
+ var BINARY = "shellcheck";
4022
+ var PLATFORM_MAP = {
4023
+ "darwin-arm64": { suffix: "darwin.x86_64", format: "tar.xz" },
4024
+ "darwin-x64": { suffix: "darwin.x86_64", format: "tar.xz" },
4025
+ "linux-x64": { suffix: "linux.x86_64", format: "tar.xz" },
4026
+ "linux-arm64": { suffix: "linux.aarch64", format: "tar.xz" }
4027
+ };
4028
+ async function getVersionFromBinary(binaryPath) {
4029
+ try {
4030
+ const { stdout, exitCode } = await (0, import_tooling.spawnTool)(binaryPath, ["--version"], {
4031
+ cwd: process.cwd()
4032
+ });
4033
+ if (exitCode !== 0) return null;
4034
+ const match = stdout.match(/version:\s*(\S+)/);
4035
+ return match ? match[1] : null;
4036
+ } catch {
4037
+ return null;
4038
+ }
4039
+ }
4040
+ async function resolveBinaryPath(ctx) {
4041
+ const codacyBin = import_path.default.join(ctx.toolInstallDir, BINARY);
4042
+ const version = await getVersionFromBinary(codacyBin);
4043
+ if (version) return codacyBin;
4044
+ return BINARY;
4045
+ }
4046
+ var adapter = {
4047
+ id: TOOL_ID,
4048
+ displayName: "ShellCheck",
4049
+ preferredVersion: "0.9.0",
4050
+ compatibleVersions: ">=0.7.0",
4051
+ website: "https://www.shellcheck.net",
4052
+ languages: ["Shell"],
4053
+ filePatterns: ["**/*.sh", "**/*.bash", "**/*.ksh", "**/*.dash"],
4054
+ supportedOS: ["linux", "darwin", "win32"],
4055
+ supportedArch: ["x64", "arm64"],
4056
+ supportedRunners: ["local", "container"],
4057
+ prerequisites: [],
4058
+ /**
4059
+ * Checks whether the `shellcheck` binary is present and runnable.
4060
+ *
4061
+ * Checks in order:
4062
+ * 1. Codacy-managed path (`ctx.toolInstallDir/shellcheck`) → installation: "codacy"
4063
+ * 2. Global PATH (`shellcheck`) → installation: "global"
4064
+ *
4065
+ * Parses the version from the output line `version: X.Y.Z`. Returns
4066
+ * `available: false` (rather than throwing) if the binary is not found or
4067
+ * returns a non-zero exit code.
4068
+ */
4069
+ async checkAvailability(ctx) {
4070
+ ctx.logger.debug("Checking availability", { toolId: TOOL_ID });
4071
+ const codacyBin = import_path.default.join(ctx.toolInstallDir, BINARY);
4072
+ const codacyVersion = await getVersionFromBinary(codacyBin);
4073
+ if (codacyVersion) {
4074
+ ctx.logger.debug("Found codacy-managed binary", { toolId: TOOL_ID, version: codacyVersion, path: codacyBin });
4075
+ return { available: true, version: codacyVersion, path: codacyBin, installation: "codacy" };
4076
+ }
4077
+ const globalVersion = await getVersionFromBinary(BINARY);
4078
+ if (globalVersion) {
4079
+ ctx.logger.debug("Found global binary", { toolId: TOOL_ID, version: globalVersion });
4080
+ return { available: true, version: globalVersion, installation: "global" };
4081
+ }
4082
+ ctx.logger.debug("Binary not found", { toolId: TOOL_ID, reason: "not in PATH or Codacy install directory" });
4083
+ return {
4084
+ available: false,
4085
+ reason: "shellcheck binary not found in PATH or Codacy install directory",
4086
+ installHint: "brew install shellcheck # macOS\ncodacy-analysis analyze . --install-dependencies # auto-install"
4087
+ };
4088
+ },
4089
+ /**
4090
+ * Downloads shellcheck from GitHub releases and extracts it to ctx.toolInstallDir.
4091
+ *
4092
+ * Detects the current platform/arch and downloads the appropriate tar.xz archive.
4093
+ * Uses `--strip-components=1` to flatten the archive's inner directory.
4094
+ */
4095
+ async install(ctx) {
4096
+ ctx.logger.info("Starting install", { toolId: TOOL_ID });
4097
+ const platformKey = `${ctx.platform.os}-${ctx.platform.arch}`;
4098
+ const platformInfo = PLATFORM_MAP[platformKey];
4099
+ if (!platformInfo) {
4100
+ return {
4101
+ success: false,
4102
+ error: {
4103
+ toolId: TOOL_ID,
4104
+ phase: "toolInstall",
4105
+ kind: "UnsupportedPlatform",
4106
+ message: `Unsupported platform: ${platformKey}. Supported: ${Object.keys(PLATFORM_MAP).join(", ")}`,
4107
+ level: "error"
4108
+ }
4109
+ };
4110
+ }
4111
+ const version = adapter.preferredVersion;
4112
+ const url = `https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.${platformInfo.suffix}.${platformInfo.format}`;
4113
+ const destPath = import_path.default.join(ctx.toolInstallDir, BINARY);
4114
+ try {
4115
+ ctx.logger.info(`Downloading shellcheck v${version} for ${platformKey}...`);
4116
+ await (0, import_tooling.downloadAndExtract)(url, ctx.toolInstallDir, { stripComponents: 1 }, ctx.logger);
4117
+ await import_promises.default.chmod(destPath, 493);
4118
+ ctx.logger.info(`Installed shellcheck v${version} to ${destPath}`);
4119
+ return { success: true, installedPath: destPath, installedVersion: version };
4120
+ } catch (err) {
4121
+ return {
4122
+ success: false,
4123
+ error: {
4124
+ toolId: TOOL_ID,
4125
+ phase: "toolInstall",
4126
+ kind: "DownloadError",
4127
+ message: `Failed to download shellcheck: ${err instanceof Error ? err.message : String(err)}`,
4128
+ level: "error"
4129
+ }
4130
+ };
4131
+ }
4132
+ },
4133
+ /**
4134
+ * Checks for `.shellcheckrc` in the repository root.
4135
+ *
4136
+ * ShellCheck automatically discovers `.shellcheckrc` when it is present, so
4137
+ * this method only reports whether the file exists — the adapter does not need
4138
+ * to pass an explicit `--rcfile` unless `useLocalConfigurationFile` is set in
4139
+ * the Codacy config.
4140
+ */
4141
+ async checkLocalConfigurationFile(ctx) {
4142
+ ctx.logger.debug("Checking for local config", { toolId: TOOL_ID });
4143
+ const rcPath = import_path.default.join(ctx.repositoryRoot, ".shellcheckrc");
4144
+ try {
4145
+ await import_promises.default.access(rcPath);
4146
+ ctx.logger.debug("Local config found", { toolId: TOOL_ID, path: rcPath });
4147
+ return { found: true, path: rcPath };
4148
+ } catch {
4149
+ return { found: false };
4150
+ }
4151
+ },
4152
+ /**
4153
+ * Runs `shellcheck --format json` against the target files and converts the
4154
+ * JSON output into Codacy Issue objects.
4155
+ *
4156
+ * Config resolution:
4157
+ * - If `useLocalConfigurationFile` is true and `localConfigurationFile` is
4158
+ * set, passes `--rcfile <path>` so shellcheck uses that specific config.
4159
+ * - Otherwise, shellcheck discovers `.shellcheckrc` automatically (if present)
4160
+ * and uses its built-in defaults otherwise.
4161
+ *
4162
+ * Note: ShellCheck does not support pattern-based rule filtering via flags —
4163
+ * rules can only be disabled via inline comments or an rcfile. When Codacy
4164
+ * patterns are provided without a local config, we run with all rules enabled
4165
+ * and accept the limitation that rule filtering is not applied.
4166
+ *
4167
+ * Exit codes:
4168
+ * - 0: success, no issues found
4169
+ * - 1: success, issues found (normal — not treated as an error)
4170
+ * - 2+: genuine error (binary not found, invalid arguments, etc.)
4171
+ *
4172
+ * Line content is resolved by reading each unique file once and caching the
4173
+ * lines, so files with multiple issues are not read repeatedly.
4174
+ *
4175
+ * Never throws — all errors are captured in the returned `errors` array.
4176
+ */
4177
+ async analyze(ctx, codacyConfig) {
4178
+ const startMs = Date.now();
4179
+ ctx.logger.info("Starting analysis", { toolId: TOOL_ID, fileCount: ctx.targetFiles.length });
4180
+ const startedAt = /* @__PURE__ */ new Date();
4181
+ const issues = [];
4182
+ const errors = [];
4183
+ if (ctx.targetFiles.length === 0) {
4184
+ return buildResult(startedAt, /* @__PURE__ */ new Date(), issues, errors, 0);
4185
+ }
4186
+ const binary = await resolveBinaryPath(ctx);
4187
+ const absoluteFiles = ctx.targetFiles.map((f) => import_path.default.resolve(ctx.repositoryRoot, f));
4188
+ const args = ["--format", "json"];
4189
+ if (codacyConfig.useLocalConfigurationFile && codacyConfig.localConfigurationFile) {
4190
+ args.push("--rcfile", codacyConfig.localConfigurationFile);
4191
+ }
4192
+ args.push(...absoluteFiles);
4193
+ try {
4194
+ const { stdout, stderr, exitCode } = await (0, import_tooling.spawnTool)(binary, args, {
4195
+ cwd: ctx.repositoryRoot,
4196
+ logger: ctx.logger
4197
+ });
4198
+ if (exitCode >= 2) {
4199
+ errors.push({
4200
+ toolId: TOOL_ID,
4201
+ phase: "toolInvoke",
4202
+ kind: "NonZeroExit",
4203
+ message: `shellcheck exited with code ${exitCode}${stderr ? `: ${stderr.trim()}` : ""}`,
4204
+ level: "error"
4205
+ });
4206
+ return buildResult(startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
4207
+ }
4208
+ if (!stdout.trim()) {
4209
+ return buildResult(startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
4210
+ }
4211
+ let findings;
4212
+ try {
4213
+ findings = JSON.parse(stdout);
4214
+ } catch (err) {
4215
+ errors.push({
4216
+ toolId: TOOL_ID,
4217
+ phase: "outputParse",
4218
+ kind: "MalformedOutput",
4219
+ message: `Failed to parse shellcheck JSON output: ${err instanceof Error ? err.message : String(err)}`,
4220
+ level: "error"
4221
+ });
4222
+ return buildResult(startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
4223
+ }
4224
+ const enabledPatterns = new Set(codacyConfig.patterns.map((p) => p.patternId));
4225
+ const findingsByFile = /* @__PURE__ */ new Map();
4226
+ for (const finding of findings) {
4227
+ const list = findingsByFile.get(finding.file) ?? [];
4228
+ list.push(finding);
4229
+ findingsByFile.set(finding.file, list);
4230
+ }
4231
+ for (const [absoluteFilePath, fileFindings] of findingsByFile) {
4232
+ const lines = await readFileLines(absoluteFilePath);
4233
+ const relPath = import_path.default.relative(ctx.repositoryRoot, absoluteFilePath);
4234
+ for (const finding of fileFindings) {
4235
+ const patternId = `${TOOL_ID}_SC${finding.code}`;
4236
+ if (enabledPatterns.size > 0 && !enabledPatterns.has(patternId)) {
4237
+ continue;
4238
+ }
4239
+ const meta = ruleMetadata(finding.code);
4240
+ issues.push({
4241
+ filePath: relPath,
4242
+ patternId,
4243
+ toolId: TOOL_ID,
4244
+ line: finding.line,
4245
+ column: finding.column,
4246
+ endLine: finding.endLine,
4247
+ endColumn: finding.endColumn,
4248
+ message: finding.message,
4249
+ lineContent: getLineContent(lines, finding.line),
4250
+ multilineContent: (0, import_tooling.getMultilineContent)(lines, finding.line, finding.endLine),
4251
+ category: meta.category,
4252
+ severity: meta.severity
4253
+ });
4254
+ }
4255
+ }
4256
+ if (stderr.trim()) {
4257
+ errors.push({
4258
+ toolId: TOOL_ID,
4259
+ phase: "outputParse",
4260
+ kind: "ParseWarning",
4261
+ message: `shellcheck stderr: ${stderr.trim()}`,
4262
+ level: "warning"
4263
+ });
4264
+ }
4265
+ } catch (err) {
4266
+ errors.push({
4267
+ toolId: TOOL_ID,
4268
+ phase: "toolInvoke",
4269
+ kind: "InvocationError",
4270
+ message: `Failed to run shellcheck: ${err instanceof Error ? err.message : String(err)}`,
4271
+ level: "error"
4272
+ });
4273
+ }
4274
+ const durationMs = Date.now() - startMs;
4275
+ ctx.logger.info("Analysis complete", { toolId: TOOL_ID, issueCount: issues.length, errorCount: errors.length, durationMs });
4276
+ return buildResult(startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
4277
+ }
4278
+ };
4279
+
4280
+ // src/index.ts
4281
+ var index_default = (0, import_tooling2.defineToolAdapter)(adapter);