mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Accept dir-/basename due to edge cases like "/" and "foo"
This commit is contained in:
parent
b9f7f82e29
commit
3a9ae0ebf1
1 changed files with 0 additions and 4 deletions
|
@ -314,10 +314,6 @@ prop_checkNeedlessCommands = verify checkNeedlessCommands "foo=$(expr 3 + 2)"
|
|||
prop_checkNeedlessCommands2 = verify checkNeedlessCommands "foo=`echo \\`expr 3 + 2\\``"
|
||||
checkNeedlessCommands (T_SimpleCommand id _ (w:_)) | w `isCommand` "expr" =
|
||||
style id "expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]]."
|
||||
checkNeedlessCommands (T_SimpleCommand id _ (w:_)) | w `isCommand` "dirname" =
|
||||
style id "Use parameter expansion instead, such as ${var%/*}."
|
||||
checkNeedlessCommands (T_SimpleCommand id _ (w:_)) | w `isCommand` "basename" =
|
||||
style id "Use parameter expansion instead, such as ${var##*/}."
|
||||
checkNeedlessCommands _ = return ()
|
||||
|
||||
prop_checkPipePitfalls3 = verify checkPipePitfalls "ls | grep -v mp3"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue