Vidar Holen
1ac2c31728
Warn when shell functions blatantly recurse ( fixes #1994 )
2020-07-27 21:50:33 -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
5cf2c00ff7
Warn about defining and using an alias in a single command ( fixes #1807 )
2020-05-25 23:24:33 -07:00
Vidar Holen
c2a15ce8e9
Allow disabling SC1072/SC1073 with annotations ( fixes #1931 )
2020-05-03 21:57:16 -07:00
Vidar Holen
2030b83607
Warn about duplicate uses of stdin/out/err
2020-05-03 11:54:25 -07:00
Vidar Holen
84d6e53659
Update Changelog with new version
2020-04-04 19:29:49 -07:00
Vidar Holen
f7547c9a5a
Stable version v0.7.1
...
This release is dedicated to the board game Pandemic, for teaching us
relevant survival skills like how to stay inside and play board games.
2020-04-04 18:38:39 -07:00
Vidar Holen
a57f6d2886
Improve detection of for loops with single values
2020-03-15 11:30:56 -07:00
Vidar Holen
7b998239af
SC2257: Warn when changing arithmetic variables in redirections
2020-02-17 18:16:57 -08:00
Vidar Holen
106f321cf0
Parse keywords with case sensitivity ( fixes #1809 )
2020-02-17 11:13:29 -08: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
0f15fa49ba
Make SC2230 optional
2019-12-07 16:11:49 -08:00
Vidar Holen
0a4580e234
Mention that ShellCheck is now compatible with Cabal 3
2019-12-07 16:11:49 -08:00
Benjamin Gordon
2341a4c683
SC2256: Check for translated strings matching known variables
...
SC2247 already warns about translated strings that look like $"(foo)" or
$"{foo}". Since typical use of translated strings is to translate whole
messages, a string like $"foo" is likely to be a similar mistake if foo
is the name of an existing variable. Conversely, a string like
$"foo bar" is potentially meant to be a message id even if foo is a
known variable.
Add a warning for the $"foo" case, but make it separate from the
existing warning so that projects that reuse variable names as their
message ids can separately disable the new warning.
2019-11-13 16:41:16 -07:00
Vidar Holen
5962b01816
Correctly handle empty variables for SC2086 ( fixes #1722 )
2019-11-03 12:46:25 -08:00
Tito Sacchi
5becc673b2
Modify CHANGELOG.md
2019-11-01 14:36:15 +01: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
Vidar Holen
afea62de4e
Suggest using `$((..))` in `[ 2*3 -eq 6 ]` ( fixes #1641 )
2019-10-12 19:55:20 -07:00
Vidar Holen
e01c470598
Suggest quoting case patterns, as for SC2053 ( fixes #1682 )
2019-09-08 20:08:43 -07:00
Vidar Holen
c175971bf0
Make `-f diff` stop saying it found more issues when it didn't.
2019-07-28 20:50:50 -07:00
Vidar Holen
b7b4d5d29e
Stable version 0.7.0
...
This release is dedicated to RetroArch: the second best way to make your
PC feel like a 16bit system (right after building ShellCheck with GHC)
2019-07-28 18:12:25 -07:00
Vidar Holen
b2dd00e4ee
Mention aarch64 and macOS binaries in CHANGELOG
2019-07-28 17:26:31 -07:00
Vidar Holen
023ae5dfda
Don't warn about printf '%()T' without corresponding argument
2019-07-20 15:10:41 -07:00
Vidar Holen
bee4303c32
Add an empty Custom.hs to simplify site-specific patching
2019-07-02 20:07:05 -07:00
Vidar Holen
561075ea79
Merge branch 'shflags' of https://github.com/yetamrra/shellcheck into yetamrra-shflags
2019-07-01 20:00:28 -07:00
Vidar Holen
544047c5af
Warn about ending double quotes just to make $ literal
2019-06-30 18:43:42 -07:00
Benjamin Gordon
f6ba500d6b
Add support for basic shflags semantics
...
The shflags command-line flags library creates variables at runtime
with a few well-defined functions. This causes shellcheck to spit out
lots of warnings about unassigned variables, as well as miss warnings
about unused flag variables.
We can address this with two parts:
1. Pretend that the shflags global variables are predefined like other
shell variables so that shellcheck doesn't expect users to set them.
2. Treat DEFINE_string, DEFINE_int, etc. as new commands that create
variables, similar to the existing read, local, mapfile, etc.
Part 1 can theoretically be addresssed without this by following sourced
files, but that doesn't help if people are otherwise not following
external sources.
The new behavior is on by default, similar to automatic bats test
behavior.
Addresses #1597
2019-06-25 12:14:54 -06:00
Vidar Holen
b1aeee564c
Add a Diff output format
2019-06-23 20:02:01 -07:00
Vidar Holen
9f0ef5983a
Optionally check for unassigned uppercase variables
2019-06-02 10:29:04 -07:00
Vidar Holen
3e7c2bfec0
Warn about [ $a != x ] || [ $a != y ]
2019-06-02 09:26:54 -07:00
Vidar Holen
95b1185882
Inform about ineffectual ! on commands ( fixes #1531 )
2019-05-22 17:14:28 -07:00
Benjamin Gordon
64c9c83cc8
SC2250: New optional check for braces around variable references
...
Always using braces makes it harder to accidentally change a variable by
pasting other text next to it, but the warning is off by default because
it's definitely a style preference. Omit special and positional
variables from the check because appending additional characters to them
already doesn't change parsing.
2019-05-14 11:01:38 -06:00
Benjamin Gordon
50af8aba29
Add json1 format that ignores tabs
...
The new json1 format works just like json except that it treats tabs as
single characters instead of 8-character tabstops.
The main use case is to allow editors to pass -fjson1 so that they can
consume the json output in a character-oriented way without breaking
backwards compatibility.
Also addresses #1048 .
2019-05-13 10:55:16 -06:00
Vidar Holen
5fb1da6814
Replace verbose checks with optional checks
2019-05-12 19:14:04 -07:00
Vidar Holen
d9e419d60f
Add support for source-path directives ( fixes #1577 )
2019-05-09 19:54:41 -07:00
Vidar Holen
bf1003eae3
Auto-disable SC2119 when disabling SC2120 ( fixes #703 )
2019-04-27 15:20:07 -07:00
Vidar Holen
c6c12f52bd
Expand root paths into source paths
2019-04-24 18:51:24 -07:00
Vidar Holen
5b7354918f
SC2249: When verbose, warn about missing default case ( fixes #997 )
2019-04-14 16:58:17 -07:00
Vidar Holen
b76c0a8221
SC2248: Warn about unquoted variables without special chars
2019-04-13 20:19:13 -07:00
Vidar Holen
c860b74505
Set SC2243/SC2244 level to "verbose"
2019-04-13 13:40:18 -07:00
Vidar Holen
9652ccfdbd
Add a verbose mode: `-S verbose`
2019-04-13 13:16:41 -07:00
Vidar Holen
f514f5f735
Warn about flipped $ and " in $"(cmd)" ( fixes #1517 )
2019-03-20 22:10:04 -07:00
Vidar Holen
581bcc3907
Add support for `.shellcheckrc` files
2019-03-03 18:57:13 -08:00
Vidar Holen
6dcf4b8e64
Mention extension in changelog and man page
2019-01-21 16:55:01 -08:00
Vidar Holen
e1fe9be7af
Fix minor details in new Bats support
2019-01-20 14:02:42 -08:00
Vidar Holen
e0a4241baa
Warn if a shebang's interpreter ends in / ( fixes #373 )
2019-01-13 17:32:25 -08:00
Vidar Holen
1835ebd3a0
SC2245: Warn that Ksh [ -f * ] only applies to first ( Fixes #1452 )
2019-01-13 16:41:08 -08:00
Vidar Holen
73822c3588
Allow SC2243 and SC2244 to trigger with quotes, add fix
2018-12-28 19:02:06 -08:00
Vidar Holen
3cba76dc7d
Update CHANGELOG with new release and autofix merge
2018-12-09 15:01:08 -08:00
Vidar Holen
cb57b4a74f
Stable version 0.6.0
...
This release is dedicated to Factorio. If this is how much fun it is to
build factories and oppress natives, then history makes a lot of sense.
2018-12-02 19:08:06 -08:00
Vidar Holen
a7a404a5a8
Fill in missing bits in CHANGELOG
2018-12-02 14:49:04 -08:00
Vidar Holen
cb76951ad2
Add warnings for 'exit' similar to 'return' ( fixes #1388 )
2018-11-24 23:05:40 -08:00
Zero King
f4044fbcc7
Fix typo in CHANGELOG
2018-11-08 03:07:52 +00:00
Vidar Holen
2827b35696
SC2240: Warn about `. script args..` in sh/dash ( fixes #1373 )
2018-11-07 18:04:18 -08:00
Vidar Holen
df0a0d41fa
Add SC1133: Warn when a line starts with |/||/&& ( fixes #1359 )
2018-10-21 17:46:46 -07:00
Vidar Holen
07b5aa2971
Add SC2239: shebang is not absolute path.
2018-10-17 20:38:21 -07:00
Vidar Holen
e0e46e979a
Add wiki links to output, and a -W controlling it. ( Fixes #920 )
2018-10-10 21:53:43 -07:00
Vidar Holen
3e2cb26119
Add SC2238 about redirections to command names
2018-09-17 17:46:49 -07:00
Vidar Holen
3d03b0ab3b
Suggest -z/-n instead of ! -n/-z ( fixes #1326 ).
2018-08-28 20:15:54 -07:00
Vidar Holen
49250eadae
Add --severity to CHANGELOG
2018-08-18 20:06:31 -07:00
Vidar Holen
0f835a5a2c
Don't trigger SC2222 for fallthrough case branches ( fixes #1044 )
2018-07-28 12:30:06 -07:00
Vidar Holen
d8a32da07f
Retire SC1117 (unknown quoted escapes) due to noise
2018-07-26 19:23:53 -07:00
Vidar Holen
75fb4da387
Don't warn about tr '[=e=]' equivalence classes
2018-06-23 16:55:35 -07:00
Vidar Holen
366262af18
Update CHANGELOG to mention end positions
2018-06-23 16:53:44 -07:00
Vidar Holen
0adea473fd
Update CHANGELOG after release
2018-06-07 20:19:00 -07:00
Vidar Holen
a3be776f80
Stable version 0.5.0
...
This release is dedicated to Valve for keeping PC gaming awesome.
Also, for that time they proved the need for a tool like ShellCheck.
2018-05-31 20:01:42 -07:00
Vidar Holen
135cf5932f
Parse here docs as per spec ( fixes #1050 )
2018-05-26 21:01:18 -07:00
Vidar Holen
1d8047cce1
Warn about unnecessary subshells in tests
2018-05-22 22:35:37 -07:00
Vidar Holen
cf608dc2f6
Parse FD move operations like 2>&1- correctly. Fixes #1180 .
2018-05-12 18:30:35 -07:00
Stefan Knudsen
5adfce72e1
Warn about invalid arguments to sudo
2018-04-29 01:16:31 -04:00
Vidar Holen
5481ccd7f7
Warn about elseif or elsif as command names ( fixes #1177 )
2018-04-27 22:23:37 -07:00
Vidar Holen
4aca1ff128
Warn when printf arg count is not a multiple of format count
2018-03-28 08:57:38 -07:00
Vidar Holen
764b242f1b
Suggest quoting expansions in for loop globs
2018-03-24 17:43:20 -07:00
Vidar Holen
a98d69f4ff
Update CHANGELOG with $var[ and here doc expansion fixes
2018-03-04 15:42:52 -08:00
Vidar Holen
ecb9d07f52
Update changelog with associative arrays in (()) fix
2018-02-25 18:15:55 -08:00
Vidar Holen
b7a8b090d2
SC2229: Warn about 'read $var'
2018-02-25 13:47:58 -08:00
Vidar Holen
72044a79c6
Update changelog
2018-02-25 13:47:58 -08:00
Vidar Holen
c86885427c
Warn about comments/blanks before shebang. Fixes #844
2018-01-21 13:57:44 -08:00
Vidar Holen
7b3c4025fb
Warn about redirs in the middle of 'find' commands. Fixes #405
2018-01-21 11:12:22 -08:00
Vidar Holen
46a3019ed7
Fix annotations for here documents ( fixes #1071 )
2018-01-17 19:20:10 -08:00
Vidar Holen
1d0db9267d
Mention SC2224-6 about mv/cp/ln without destination
2018-01-17 18:32:07 -08:00
Vidar Holen
a6fb9d1ef8
Warn about C-style comments
2018-01-17 18:14:36 -08:00
Vidar Holen
5b14dba489
Parse 'else if' correctly, and not like elif. Fixes #1088 .
2018-01-13 22:42:19 -08:00
Vidar Holen
3c5c74ff04
Add quote warning specific to : ${var=val}. Fixes #1084
2018-01-06 10:53:53 -08:00
Vidar Holen
c36f6d89ba
Stable version 0.4.7
...
This release is dedicated to net neutrality. Remember when the Internet
was a meritocracy? [Please drink a verification can to continue.]
2017-12-08 20:29:12 -08:00
Vidar Holen
e801da0621
Add a changelog
2017-12-07 17:49:43 -08:00