Commit graph

120 commits

Author SHA1 Message Date
Vidar Holen
d0dd81e1fa Allow quoting values in directives (fixes #2517) 2022-07-28 08:56:44 -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
2f28847b08 Normalize spaces around = in unit tests 2022-07-22 16:35:14 -07:00
Vidar Holen
f77a545282 Control Flow Graph / Data Flow Analysis support 2022-07-20 08:08:24 -07:00
Vidar Holen
a4042f7523 Parse &&/|| as left-associative 2022-07-20 08:08:24 -07:00
Vidar Holen
363c0633e0 When reparsing array indices, do it recursively 2022-07-20 08:08:24 -07:00
Vidar Holen
ade2bf7b87 Allow parsing [[ x = ["$y"] ]] (fixes #2165) 2022-01-09 16:50:50 -08:00
Vidar Holen
3b6972fbf1 Update copyright years 2021-11-06 19:07:34 -07:00
Vidar Holen
e7df718724 Strip lines containing "STRIP" from ./striptests 2021-09-18 20:43:42 -07:00
Vidar Holen
2536507060 Remove SC1004 (fixes #2326) 2021-09-18 17:43:55 -07:00
Vidar Holen
09aa15c9b7 Allow disable=all to disable all warnings (fixes #2323) 2021-09-18 12:50:01 -07:00
Vidar Holen
4e703e5c61 Allow specifying external-sources=true in shellcheckrc (fixes #1818) 2021-09-15 18:02:37 -07:00
Vidar Holen
081f7eba24 Fix parsing of [$var] (fixes #2309) 2021-08-26 23:05:14 -07:00
Vidar Holen
e5745568e8 Extend warnings about spaces around = to 'let' 2021-08-08 15:48:50 -07:00
Vidar Holen
8be60028ef Don't warn when line starts with &> (fixes #2281) 2021-07-22 19:25:48 -07:00
Vidar Holen
9b077e28cb Add :/. to chars recognized for \alias suppression (fixes #2287) 2021-07-21 16:44:21 -07:00
Kamil Cukrowski
5100960303 Add a comma to function characters
Bash has very relaxed function name rules and a comma is also a valid
character. This commit silences SC1036 check when a function name has a
comma in its name.
2021-05-26 10:58:38 +02:00
Vidar Holen
98952df35b Improve warnings on backslashes in comments 2021-03-20 18:12:39 -07:00
Vidar Holen
a277efdbb1 Merge branch 'comment-backslash' of https://github.com/m-ildefons/shellcheck into m-ildefons-comment-backslash 2021-03-20 13:34:40 -07:00
Vidar Holen
f02c297fdd Merge parser and analyzer shebang parsing 2021-03-11 23:04:17 -08:00
Vidar Holen
ea83b602d7 Merge branch 'busybox' of https://github.com/austin987/shellcheck into austin987-busybox 2021-03-11 21:44:17 -08:00
Moritz Röhrich
d6bb8fc0d8 Error on backslash in comment #2132
- Report error in case of a backspace in a comment

Backspaces in comments are no good. In most cases they are the result of
commenting out a longer line, that was broken down. This usually results
in the shell treating the following lines as their own commands on their
own lines instead of as parts of the longer, broken down line.
2021-02-14 19:13:29 +01:00
Claudio Bley
8bb5e01401 Allow env to have flags and variables in shebang
The `env` command has a `-S,--split-string` option which enables
having arguments for the command in a shebang.

Also, one could use variable assignments for the command since
`env` treats only the first word without a `=` character as the
command to run.

Fixes #2143.
2021-02-12 10:53:54 +01:00
Austin English
2e59eba6eb add support for /bin/busybox sh shebang 2021-02-05 19:56:44 -06:00
Vidar Holen
15ff87cf80
Merge pull request #2119 from josephcsible/refactors
Various refactorings
2021-02-02 18:14:27 -08:00
Vidar Holen
2e5c56b270 Parse heredocs correctly with carriage returns (fixes #2103) 2020-12-31 13:19:14 -08:00
Vidar Holen
9584266a8b Escape control characters when adding user data to messages 2020-12-31 12:28:48 -08:00
Vidar Holen
fbb14d6b38 Improve checks for = in command names (fixes #2102) 2020-12-30 20:30:43 -08:00
Joseph C. Sible
953d9bc56d Remove unused helper stub 2020-12-28 18:13:34 -05:00
Joseph C. Sible
e272fa04ee Remove redundant bind and return 2020-12-28 18:13:34 -05:00
Joseph C. Sible
eaccd3d02c Simplify parser 2020-12-28 17:19:08 -05:00
Vidar Holen
8e332ce879 Improve handling of trailing tokens for []/compounds (fixes #2091) 2020-12-06 21:26:24 -08:00
Vidar Holen
58783ab3cc Allow specifying ranges in disable directives 2020-09-01 16:22:15 -07:00
Vidar Holen
c9be7ab2eb Parse assignments according to spec (fixes #2022) 2020-08-23 18:46:13 -07:00
Vidar Holen
cc81bdee31 Improve SC1033/SC1034 message 2020-07-27 18:44:07 -07:00
Vidar Holen
210cdcd01a Treat $x/ or $(x)/ as ./ when finding sourced files (fixes #1998) 2020-06-28 17:24:07 -07:00
Vidar Holen
b52f58473d
Merge pull request #1999 from aureliojargas/patch-1
SC1102: Fix typo in error message: substition
2020-06-28 16:04:56 -07:00
Vidar Holen
739eaadbf5 Warn about extra spaces between ((s in for((;;)) 2020-06-28 16:01:15 -07:00
Aurelio Jargas
a61d8a232c
SC1102: Fix typo in error message: substition 2020-06-26 02:13:33 +02:00
Vidar Holen
12d9c1b76d Clarify that SC1090 refers to ShellCheck, not sh 2020-06-24 11:50:27 -07:00
Vidar Holen
c2a15ce8e9 Allow disabling SC1072/SC1073 with annotations (fixes #1931) 2020-05-03 21:57:16 -07:00
Ville Skyttä
60e80e4ce1 Spelling fixes 2020-04-25 08:29:38 +03:00
Joseph C. Sible
3e17a20965 Simplify thenSkip, and use in another location 2020-04-11 17:29:28 -04:00
Vidar Holen
99d6df8a08 Bump SC1102/SC1105 about ambiguous $(( to Error (fixes #1836) 2020-02-17 12:27:24 -08:00
Vidar Holen
106f321cf0 Parse keywords with case sensitivity (fixes #1809) 2020-02-17 11:13:29 -08:00
Vidar Holen
b88b253cad
Merge pull request #1827 from josephcsible/nofromjust2
Remove more unnecessary uses of fromJust
2020-02-10 18:01:38 -08:00
Joseph C. Sible
6d06103cab Remove unnecessary uses of head 2020-02-09 23:18:09 -05:00
Joseph C. Sible
ffbbfcfe25 Use mapM_ and sequence_ instead of reimplementing them 2020-02-09 23:17:52 -05:00
Joseph C. Sible
4fd8de058b Remove more unnecessary uses of fromJust 2020-02-08 23:48:36 -05:00
Joseph C. Sible
76b798394f Use case matching instead of null
Using null followed by a head, tail, or a partial pattern match is
an anti-pattern. Use case matching instead.
2020-02-01 23:07:16 -05:00