Vidar Holen
a524929b69
Remove outdated test
2022-10-12 20:22:02 -07:00
Vidar Holen
fa7943ac0e
Revert "Add employer mandated disclaimer"
...
This reverts commit 5202072a34
.
2022-10-11 20:10:34 -07:00
Vidar Holen
81c2ecaccb
Remove true/false from SC2216/SC2217 ( fixes #2603 )
2022-10-11 19:40:29 -07:00
Vidar Holen
fcba462a99
Merge pull request #2602 from DoxasticFox/issue-2550
...
Fix false positive for SC2312 when using `time`
2022-10-09 11:55:39 -07:00
Christian Nassif-Haynes
43aca62ca7
Fix false positive for SC2312 when using `time`
2022-10-10 03:33:38 +11:00
Peter Oliver
128351f5ef
Permit colon after exec
...
ShellCheck throws warning SC2093 when a script contains commands that could never be executed because they are after an `exec`. Command `:` does nothing, so add it to the list of commands that don’t trigger this warning.
2022-10-07 17:02:31 +01:00
Vidar Holen
d71d6ff294
Merge pull request #2581 from larryv/updatebashvars
...
Support more Bash internal variables
2022-09-25 11:24:45 -07:00
Vidar Holen
bd65b67578
Merge pull request #2586 from DoxasticFox/issue-2537
...
Suppress SC2311 with `set -o posix`
2022-09-25 11:04:30 -07:00
Vidar Holen
149b4dbd6f
Merge pull request #2588 from DoxasticFox/issue-2563
...
Add `mapfile` to harmless commands for SC2094
2022-09-25 11:03:45 -07:00
Christian Nassif-Haynes
ef5f9a7af5
Add `mapfile` to harmless commands for SC2094
2022-09-25 03:04:20 +10:00
Christian Nassif-Haynes
581981ba76
Suppress SC2311 with `set -o posix`
2022-09-24 07:20:48 +10:00
Vidar Holen
fcc473e27f
Include inherited env for DFA of leftover functions ( fixes #2560 )
2022-09-21 18:11:18 -07:00
Lawrence Velázquez
0845b81183
Add READLINE_POINT to list of variables without spaces
2022-09-20 20:39:17 -04:00
Lawrence Velázquez
966fb3e3dd
Recognize more Bash internal variables
...
- BASH_ARGV0, introduced in Bash 5.0
- BASH_COMPAT, 4.3
- BASH_LOADABLES_PATH, 4.4
- CHILD_MAX, 4.3
- EPOCHREALTIME, 5.0
- EPOCHSECONDS, 5.0
- EXECIGNORE, 4.4
- INSIDE_EMACS, 4.4
- PS0, 4.4
- READLINE_ARGUMENT, 5.2
- READLINE_MARK, 5.1
- SRANDOM, 5.1
Fixes #1780 and #2554 .
2022-09-20 20:39:10 -04:00
Lawrence Velázquez
f28462b01c
Remove duplicate "COPROC" from internal vars list
2022-09-20 20:25:21 -04:00
Lawrence Velázquez
ccab132b38
Reflow lists of internal shell variables
...
No functional changes; this just makes the next few commits cleaner.
2022-09-20 20:24:37 -04:00
Vidar Holen
4806719035
Handle variable assignments from `read` in CFG
2022-08-02 15:47:59 -07:00
Vidar Holen
0df9345142
Trace numerical status, use for SC2071 (ref #2541 )
2022-08-02 11:29:56 -07:00
Vidar Holen
77069f7445
Store postdominators as Array Node [Node] for a significant win
2022-07-31 15:43:24 -07:00
Vidar Holen
04db46381f
Use Data.Map.Strict instead for a ~15% parsing speedup
2022-07-29 09:02:45 -07:00
Vidar Holen
c76b8d9a32
Let annotations take effect earlier ( fixes #2534 )
2022-07-28 11:05:16 -07:00
Vidar Holen
d0dd81e1fa
Allow quoting values in directives ( fixes #2517 )
2022-07-28 08:56:44 -07:00
Vidar Holen
f440912279
Refactor to not generate Parameters twice
2022-07-28 08:26:56 -07:00
Vidar Holen
3ce310e939
Plug space leaks when processing multiple files
2022-07-27 14:42:57 -07:00
Vidar Holen
a30ac402eb
Don't use & for updates as result is unspecified
...
This fixes `Prelude.foldl1: empty list []` when script has `( exit )`
2022-07-27 11:30:26 -07:00
Vidar Holen
4a27c9a8d5
Fix overlap check
2022-07-26 15:33:25 -07:00
Vidar Holen
b5f5e6347d
Discard next rather than existing fixes when they overlap
2022-07-26 13:41:22 -07:00
Vidar Holen
c57e447c89
Correctly discard overlapping fixes in diff output ( fixes #2370 )
2022-07-26 10:16:12 -07:00
Vidar Holen
e9784fa9a7
Refine #2544 to not warn when $? postdominates [ ] ( fixes #2544 )
2022-07-25 12:00:59 -07:00
Vidar Holen
f1148b8b41
Include postdominators in CFGResult
2022-07-25 12:00:53 -07:00
Vidar Holen
982681fc05
Add unit test to ensure SC2321 does not trigger on associative arrays
2022-07-24 14:30:31 -07:00
Vidar Holen
52dac51cd4
SC2323: Warn about redundant parens in a[(x+1)] and $(( ((x)) )) (ref: #1666 )
2022-07-24 14:18:38 -07:00
Vidar Holen
30bb0e0093
SC2321: Warn about redundant $(()) in arr[$((i))]=x (ref: #1666 )
2022-07-24 14:18:38 -07:00
Vidar Holen
d1d574c091
Merge branch 'ygeyzel-grammer_fix_sc2183'
2022-07-23 15:39:26 -07:00
Vidar Holen
ea4e0091c7
Additionally pluralize 'arguments' in SC2183
2022-07-23 15:38:42 -07:00
Vidar Holen
81d9f7e640
Merge branch 'grammer_fix_sc2183' of https://github.com/ygeyzel/shellcheck into ygeyzel-grammer_fix_sc2183
2022-07-23 15:34:22 -07:00
Vidar Holen
69469c3603
Merge pull request #2543 from ygeyzel/SC2028-escape-chars
...
Add escape characters to SC2028: \a, \b, \e, \f, \v, \\, \', \OOO, \xHH
2022-07-23 15:30:00 -07:00
Vidar Holen
5cf6e01ce9
Warn when $? refers to echo or condition (ref #2541 )
2022-07-23 09:39:26 -07:00
ygeyzel
f7857028f7
Add escape characters to SC2028: \a, \b, \e, \f, \v, \\, \', \OOO, \xHH
2022-07-23 19:28:37 +03:00
Vidar Holen
b261ec24f9
Include exit codes in DFA (ref #2541 )
2022-07-23 08:50:19 -07:00
Vidar Holen
819470fa1d
Omit SC3021 about `>& file` unless definitely non-numeric ( fixes #2520 )
2022-07-22 17:06:24 -07:00
Vidar Holen
2f28847b08
Normalize spaces around = in unit tests
2022-07-22 16:35:14 -07:00
Vidar Holen
e47480e93a
Also emit SC2004 for array indices ( fixes #1666 )
2022-07-22 16:29:52 -07:00
Vidar Holen
9caeec104b
SC2318: Warn about backreferencing in `declare x=1 y=$x` ( fixes #1653 )
2022-07-22 12:40:59 -07:00
Vidar Holen
95b3cbf071
Qualify Data.Map as M instead of tedious Map
2022-07-22 11:11:09 -07:00
Vidar Holen
e7f05d662a
In addition to start/end, track sets of nodes belonging to tokens
2022-07-22 10:29:19 -07:00
Vidar Holen
3ee4419ef4
Suppress SC2086 for variables declared -i (ref #2541 )
2022-07-22 08:53:27 -07:00
Vidar Holen
8dc0fdb4cc
Precompile new fgl dependency on armv6hf
2022-07-20 12:52:57 -07:00
Vidar Holen
da4885a71d
Use DFA for SC2086
2022-07-20 08:08:44 -07:00
Vidar Holen
642ad86125
Add SC2317 warning about unreachable commands
2022-07-20 08:08:41 -07:00