Skip to content

Commit

Permalink
Add a unit test and separate ids for 884eff0
Browse files Browse the repository at this point in the history
  • Loading branch information
koalaman committed May 24, 2018
1 parent d140388 commit 467dfe0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/ShellCheck/Checker.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,9 @@ prop_filewideAnnotationBase2 = [2086, 2181] == check "true\n[ $? == 0 ] && echo
prop_filewideAnnotation8 = null $
check "# Disable $? warning\n#shellcheck disable=SC2181\n# Disable quoting warning\n#shellcheck disable=2086\ntrue\n[ $? == 0 ] && echo $1"

prop_sourcePartOfOriginalScript = -- #1181: -x disabled posix warning for 'source'
2039 `elem` checkWithIncludes [("./saywhat.sh", "echo foo")] "#!/bin/sh\nsource ./saywhat.sh"


return []
runTests = $quickCheckAll
5 changes: 3 additions & 2 deletions src/ShellCheck/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1918,11 +1918,12 @@ readSource pos t@(T_Redirecting _ _ (T_SimpleCommand _ _ (cmd:file:_))) = do
"Not following: " ++ err
return t
Right script -> do
id <- getNextIdAt pos
id1 <- getNextIdAt pos
id2 <- getNextIdAt pos

let included = do
src <- subRead filename script
return $ T_SourceCommand id t (T_Include id src)
return $ T_SourceCommand id1 t (T_Include id2 src)

let failed = do
parseNoteAt pos WarningC 1094
Expand Down

0 comments on commit 467dfe0

Please sign in to comment.