Use null instead of comparing with empty lists

This commit is contained in:
Joseph C. Sible 2020-02-01 22:50:21 -05:00
parent e6e89d68fd
commit c29b6afa56
5 changed files with 14 additions and 14 deletions

View file

@ -563,7 +563,7 @@ checkShebang params (T_Annotation _ list t) =
isOverride _ = False
checkShebang params (T_Script _ (T_Literal id sb) _) = execWriter $ do
unless (shellTypeSpecified params) $ do
when (sb == "") $
when (null sb) $
err id 2148 "Tips depend on target shell and yours is unknown. Add a shebang."
when (executableFromShebang sb == "ash") $
warn id 2187 "Ash scripts will be checked as Dash. Add '# shellcheck shell=dash' to silence."
@ -2332,7 +2332,7 @@ checkWhileReadPitfalls _ (T_WhileExpression id [command] contents)
checkMuncher _ = return ()
stdinRedirect (T_FdRedirect _ fd _)
| fd == "" || fd == "0" = True
| null fd || fd == "0" = True
stdinRedirect _ = False
checkWhileReadPitfalls _ _ = return ()