Commit Graph

104 Commits

Author SHA1 Message Date
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
Joseph C. Sible c29b6afa56 Use null instead of comparing with empty lists 2020-02-01 23:04:04 -05:00
Joseph C. Sible f25b8bd03a Use gets instead of fmapping the result of get 2020-02-01 22:50:20 -05:00
Joseph C. Sible f5c6771016 Use find instead of listToMaybe and filter 2020-02-01 22:50:16 -05:00
Vidar Holen cbcca528ae Merge branch 'iss1724-builtin-support' of https://github.com/jabberabbe/shellcheck into jabberabbe-iss1724-builtin-support 2019-12-21 18:13:07 -08:00
Vidar Holen 83187dafd7 Added a unit test for parsing shell keyword case branches 2019-12-21 17:59:09 -08:00
Gandalf- 3f296a08c1 Issue 1731 Literals in case patterns
https://github.com/koalaman/shellcheck/issues/1731

Any literal except esac is valid pattern in a case statement
2019-12-18 20:23:48 -08:00
Vidar Holen 989ac32625
Merge pull request #1734 from gabrielelana/braced-regular-for
Parse regular `for` with body in curly braces
2019-11-15 20:59:51 -08:00
Vidar Holen 2bbfd0570d
Merge pull request #1735 from gabrielelana/quoted-heredoc
Support for heredoc quoted token like `'"FOO"`
2019-11-15 20:27:10 -08:00
Vidar Holen 93eca1cb8e Only trigger SC1014 when command is a complete word (fixes #1737) 2019-11-03 13:26:23 -08:00
Tito Sacchi 0e0de94045 Fix issue #1724
(bash: missing support for 'builtin' keyword)
Now shellcheck looks for the arguments to 'builtin' to determine
read/written variables. A change in the parser makes sure that
assignments are parsed correctly in commands that start with 'builtin'.
2019-11-01 13:49:17 +01:00
gabriele.lana 699aac589a Support for heredoc quoted token like `'"FOO"`
Fixes #1650
2019-10-26 17:36:32 +02:00
gabriele.lana 30c75340e6 Parse regular `for` with body in curly braces
Fixes #1694
2019-10-26 15:41:46 +02:00
Vidar Holen 60f75e5b8a Warn about unexpected characters after ]/]] (fixes #1680) 2019-10-13 20:26:40 -07:00
Vidar Holen ba2c20a08a Improve message for SC1067 2019-07-03 20:02:14 -07:00
Vidar Holen 544047c5af Warn about ending double quotes just to make $ literal 2019-06-30 18:43:42 -07:00
Vidar Holen 321afa427e Remove unused parse-time AST warnings 2019-06-30 17:38:17 -07:00