Luke Shumaker
df068bc8ed
Fix isClosingFileOp (fixes issue #862 )
...
The isClosingFileOp function expected closing file ops to use T_IoFile, but
they actually use T_IoDuplicate; so it effectively always returned False.
2017-11-05 18:53:01 -05:00
Vidar Holen
8dd40efb44
Add support for -a: emit for sourced files.
2017-08-13 19:34:45 -07:00
Martin Schwenke
807d899f3b
Fix incorrect detection of bash-style substring expansion
...
Substring expansion detection only considers ':' as a separator.. It
needs to avoid triggering for ":-", ":=", ":+" and ":?", since they
mean other things.
This is a regression introduced by commit
a90b6d14b3
Signed-off-by: Martin Schwenke <martin@meltin.net>
2017-07-20 15:59:05 +10:00
Vidar Holen
6f4e06d83c
Avoid rescanning tree for lastpipe on every node.
2017-05-28 16:04:42 -07:00
Vladimir Panteleev
505ff7832f
Recognize bash's `shopt -s lastpipe`
...
Fixes #732 .
2017-05-28 14:56:49 -07:00
Vidar Holen
070a465b64
Recognize missing and superfluous cases in getopts loops.
2017-05-28 13:38:04 -07:00
Vidar Holen
4243c6a0bf
Treat + like :+ to squash SC2068
2017-05-24 19:20:28 -07:00
Vidar Holen
5099ebf9b9
Allow comments after shellcheck directives.
2017-05-21 13:56:22 -07:00
Vidar Holen
41b6e3d5eb
Don't warn about [ -v foo ] being unassigned.
2017-04-08 15:19:47 -07:00
Vaibhav Sagar
0feb95b337
Implement fixes suggested by HLint
2017-04-08 11:07:32 -07:00
Vidar Holen
3c75674b50
Warn about unquoted expansions in arrays.
2017-04-02 14:28:12 -07:00
Vidar Holen
2688a81526
Don't suggest indirection for 'declare var$n=foo'
2017-03-18 14:54:52 -07:00
Vidar Holen
bd9d05c759
Warn about missing space in [ foo= bar ]
2016-12-27 21:20:59 -08:00
Vidar Holen
6ccb7e9129
Fix 'for file; do ..' counting $file as a safe variable.
2016-12-17 12:55:14 -08:00
Vidar Holen
fee6c94d40
Alias ash to dash with warning.
2016-12-10 10:57:01 -08:00
Vidar Holen
08f7ff37c5
Some cleanup and refactoring.
2016-11-12 15:51:36 -08:00
Vidar Holen
4fc4899803
Consider ${foo:=bar} an assignment.
2016-09-24 19:01:13 -07:00
Vidar Holen
3a7dc86de1
Don't warn about unused vars with readonly -f
2016-09-24 13:42:20 -07:00
Vidar Holen
a90b6d14b3
Count b as a reference in ${a:b}
2016-09-05 14:01:53 -07:00
Vidar Holen
13a2070a32
Support multidimensional KSH arrays and warn in Bash.
2016-08-06 18:40:08 -07:00
Vidar Holen
85e69f86eb
In (( x = y )), logic to not reference x also grabbed y
2016-05-24 09:12:47 -07:00
Vidar Holen
86999ded1f
Improve 'let' parsing, trigger unused var for ((a=1))
2016-04-30 13:45:39 -07:00
Vidar Holen
f835c2d4c1
Fix handling of spaces in shebangs.
2016-04-16 09:42:07 -07:00
Vidar Holen
db0c8c2dc9
Separate out command specific checks.
...
The checks use a better interface and give
an overall speed boost of 10%.
2016-04-10 17:01:40 -07:00