mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 19:48:11 +08:00
Add T_SourceCommand to wrap source commands and sourced code
Fixes #1181
This commit is contained in:
@@ -283,7 +283,10 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
||||
("read", if isDash then ["r", "p"] else ["r"]),
|
||||
("ulimit", ["f"])
|
||||
]
|
||||
|
||||
bashism t@(T_SourceCommand id src _) =
|
||||
let name = fromMaybe "" $ getCommandName src
|
||||
in do
|
||||
when (name == "source") $ warnMsg id "'source' in place of '.' is"
|
||||
bashism _ = return ()
|
||||
|
||||
varChars="_0-9a-zA-Z"
|
||||
|
Reference in New Issue
Block a user