mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 21:11:35 -07:00
Add T_SourceCommand to wrap source commands and sourced code
Fixes #1181
This commit is contained in:
parent
77546fba2f
commit
884eff0c36
3 changed files with 11 additions and 5 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue