Hello community,

here is the log from the commit of package ShellCheck for openSUSE:Factory 
checked in at 2018-12-10 12:29:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ShellCheck (Old)
 and      /work/SRC/openSUSE:Factory/.ShellCheck.new.19453 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ShellCheck"

Mon Dec 10 12:29:34 2018 rev:13 rq:656584 version:0.6.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ShellCheck/ShellCheck.changes    2018-10-25 
08:19:55.299976354 +0200
+++ /work/SRC/openSUSE:Factory/.ShellCheck.new.19453/ShellCheck.changes 
2018-12-10 12:29:36.838450469 +0100
@@ -1,0 +2,6 @@
+Tue Dec  4 03:02:12 UTC 2018 - psim...@suse.com
+
+- Update ShellCheck to version 0.6.0.
+  Upstream does not provide a change log file.
+
+-------------------------------------------------------------------

Old:
----
  ShellCheck-0.5.0.tar.gz

New:
----
  ShellCheck-0.6.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ShellCheck.spec ++++++
--- /var/tmp/diff_new_pack.fRHi1h/_old  2018-12-10 12:29:37.738449569 +0100
+++ /var/tmp/diff_new_pack.fRHi1h/_new  2018-12-10 12:29:37.742449565 +0100
@@ -19,7 +19,7 @@
 %global pkg_name ShellCheck
 %bcond_with tests
 Name:           %{pkg_name}
-Version:        0.5.0
+Version:        0.6.0
 Release:        0
 Summary:        Shell script analysis tool
 License:        GPL-3.0-or-later

++++++ ShellCheck-0.5.0.tar.gz -> ShellCheck-0.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/README.md 
new/ShellCheck-0.6.0/README.md
--- old/ShellCheck-0.5.0/README.md      2018-10-15 18:55:02.000000000 +0200
+++ new/ShellCheck-0.6.0/README.md      2018-12-03 04:12:56.000000000 +0100
@@ -133,6 +133,10 @@
 
     brew install shellcheck
 
+On OpenBSD:
+
+    pkg_add shellcheck
+
 On openSUSE
 
     zypper in ShellCheck
@@ -168,6 +172,11 @@
 
 or see the [storage bucket 
listing](https://shellcheck.storage.googleapis.com/index.html) for checksums, 
older versions and the latest daily builds.
 
+Distro packages already come with a `man` page. If you are building from 
source, it can be installed with:
+
+    pandoc -s -t man shellcheck.1.md -o shellcheck.1
+    sudo mv shellcheck.1 /usr/share/man/man1
+
 ## Travis CI
 
 Travis CI has now integrated ShellCheck by default, so you don't need to 
manually install it.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/Setup.hs 
new/ShellCheck-0.6.0/Setup.hs
--- old/ShellCheck-0.5.0/Setup.hs       2018-10-15 18:55:02.000000000 +0200
+++ new/ShellCheck-0.6.0/Setup.hs       2018-12-03 04:12:56.000000000 +0100
@@ -33,4 +33,4 @@
   putStrLn $ "pandoc exited with " ++ show result
   return emptyHookedBuildInfo
   where
-    pandoc_cmd = "pandoc -s -t man shellcheck.1.md -o shellcheck.1"
+    pandoc_cmd = "pandoc -s -f markdown-smart -t man shellcheck.1.md -o 
shellcheck.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/ShellCheck.cabal 
new/ShellCheck-0.6.0/ShellCheck.cabal
--- old/ShellCheck-0.5.0/ShellCheck.cabal       2018-10-15 18:55:02.000000000 
+0200
+++ new/ShellCheck-0.6.0/ShellCheck.cabal       2018-12-03 04:12:56.000000000 
+0100
@@ -1,5 +1,5 @@
 Name:             ShellCheck
-Version:          0.5.0
+Version:          0.6.0
 Synopsis:         Shell script analysis tool
 License:          GPL-3
 License-file:     LICENSE
@@ -28,6 +28,8 @@
     shellcheck.1.md
     -- built with a cabal sdist hook
     shellcheck.1
+    -- convenience script for stripping tests
+    striptests
     -- tests
     test/shellcheck.hs
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/shellcheck.1 
new/ShellCheck-0.6.0/shellcheck.1
--- old/ShellCheck-0.5.0/shellcheck.1   2018-10-15 18:55:02.000000000 +0200
+++ new/ShellCheck-0.6.0/shellcheck.1   2018-12-03 04:12:56.000000000 +0100
@@ -7,14 +7,14 @@
 shellcheck \- Shell script analysis tool
 .SH SYNOPSIS
 .PP
-\f[B]shellcheck\f[] [\f[I]OPTIONS\f[]\&...] \f[I]FILES\f[]\&...
+\f[B]shellcheck\f[] [\f[I]OPTIONS\f[]...] \f[I]FILES\f[]...
 .SH DESCRIPTION
 .PP
 ShellCheck is a static analysis and linting tool for sh/bash scripts.
-It's mainly focused on handling typical beginner and intermediate level
-syntax errors and pitfalls where the shell just gives a cryptic error
-message or strange behavior, but it also reports on a few more advanced
-issues where corner cases can cause delayed failures.
+It\[aq]s mainly focused on handling typical beginner and intermediate
+level syntax errors and pitfalls where the shell just gives a cryptic
+error message or strange behavior, but it also reports on a few more
+advanced issues where corner cases can cause delayed failures.
 .PP
 ShellCheck gives shell specific advice.
 Consider this line:
@@ -38,7 +38,7 @@
 supports decimals in arithmetic contexts.
 .SH OPTIONS
 .TP
-.B \f[B]\-a\f[],\ \f[B]\[en]check\-sourced\f[]
+.B \f[B]\-a\f[],\ \f[B]\-\-check\-sourced\f[]
 Emit warnings in sourced files.
 Normally, \f[C]shellcheck\f[] will only warn about issues in the
 specified files.
@@ -47,23 +47,23 @@
 .RS
 .RE
 .TP
-.B \f[B]\-C\f[][\f[I]WHEN\f[]],\ \f[B]\[en]color\f[][=\f[I]WHEN\f[]]
+.B \f[B]\-C\f[][\f[I]WHEN\f[]],\ \f[B]\-\-color\f[][=\f[I]WHEN\f[]]
 For TTY output, enable colors \f[I]always\f[], \f[I]never\f[] or
 \f[I]auto\f[].
 The default is \f[I]auto\f[].
-\f[B]\[en]color\f[] without an argument is equivalent to
-\f[B]\[en]color=always\f[].
+\f[B]\-\-color\f[] without an argument is equivalent to
+\f[B]\-\-color=always\f[].
 .RS
 .RE
 .TP
-.B \f[B]\-e\f[]\ \f[I]CODE1\f[][,\f[I]CODE2\f[]\&...],\ 
\f[B]\[en]exclude=\f[]\f[I]CODE1\f[][,\f[I]CODE2\f[]\&...]
+.B \f[B]\-e\f[]\ \f[I]CODE1\f[][,\f[I]CODE2\f[]...],\ 
\f[B]\-\-exclude=\f[]\f[I]CODE1\f[][,\f[I]CODE2\f[]...]
 Explicitly exclude the specified codes from the report.
 Subsequent \f[B]\-e\f[] options are cumulative, but all the codes can be
 specified at once, comma\-separated as a single argument.
 .RS
 .RE
 .TP
-.B \f[B]\-f\f[] \f[I]FORMAT\f[], \f[B]\[en]format=\f[]\f[I]FORMAT\f[]
+.B \f[B]\-f\f[] \f[I]FORMAT\f[], \f[B]\-\-format=\f[]\f[I]FORMAT\f[]
 Specify the output format of shellcheck, which prints its results in the
 standard output.
 Subsequent \f[B]\-f\f[] options are ignored, see \f[B]FORMATS\f[] below
@@ -71,7 +71,7 @@
 .RS
 .RE
 .TP
-.B \f[B]\-S\f[]\ \f[I]SEVERITY\f[],\ \f[B]\[en]severity=\f[]\f[I]severity\f[]
+.B \f[B]\-S\f[]\ \f[I]SEVERITY\f[],\ \f[B]\-\-severity=\f[]\f[I]severity\f[]
 Specify minimum severity of errors to consider.
 Valid values are \f[I]error\f[], \f[I]warning\f[], \f[I]info\f[] and
 \f[I]style\f[].
@@ -79,29 +79,30 @@
 .RS
 .RE
 .TP
-.B \f[B]\-s\f[]\ \f[I]shell\f[],\ \f[B]\[en]shell=\f[]\f[I]shell\f[]
+.B \f[B]\-s\f[]\ \f[I]shell\f[],\ \f[B]\-\-shell=\f[]\f[I]shell\f[]
 Specify Bourne shell dialect.
 Valid values are \f[I]sh\f[], \f[I]bash\f[], \f[I]dash\f[] and
 \f[I]ksh\f[].
-The default is to use the file's shebang, or \f[I]bash\f[] if the target
-shell can't be determined.
+The default is to use the file\[aq]s shebang, or \f[I]bash\f[] if the
+target shell can\[aq]t be determined.
 .RS
 .RE
 .TP
-.B \f[B]\-V\f[],\ \f[B]\[en]version\f[]
+.B \f[B]\-V\f[],\ \f[B]\-\-version\f[]
 Print version information and exit.
 .RS
 .RE
 .TP
-.B \f[B]\-W\f[] \f[I]NUM\f[],\ \f[B]\[en]wiki\-link\-count=NUM\f[]
+.B \f[B]\-W\f[] \f[I]NUM\f[],\ \f[B]\-\-wiki\-link\-count=NUM\f[]
 For TTY output, show \f[I]NUM\f[] wiki links to more information about
 mentioned warnings.
 Set to 0 to disable them entirely.
 .RS
 .RE
 .TP
-.B \f[B]\-x\f[],\ \f[B]\[en]external\-sources\f[]
-Follow `source' statements even when the file is not specified as input.
+.B \f[B]\-x\f[],\ \f[B]\-\-external\-sources\f[]
+Follow \[aq]source\[aq] statements even when the file is not specified
+as input.
 By default, \f[C]shellcheck\f[] will only follow files specified on the
 command line (plus \f[C]/dev/null\f[]).
 This option allows following any file the script may \f[C]source\f[].
@@ -160,7 +161,7 @@
 .B \f[B]json\f[]
 Json is a popular serialization format that is more suitable for web
 applications.
-ShellCheck's json is compact and contains only the bare minimum.
+ShellCheck\[aq]s json is compact and contains only the bare minimum.
 .RS
 .IP
 .nf
@@ -245,7 +246,8 @@
 .B \f[B]shell\f[]
 Overrides the shell detected from the shebang.
 This is useful for files meant to be included (and thus lacking a
-shebang), or possibly as a more targeted alternative to `disable=2039'.
+shebang), or possibly as a more targeted alternative to
+\[aq]disable=2039\[aq].
 .RS
 .RE
 .SH ENVIRONMENT VARIABLES
@@ -269,11 +271,14 @@
 .IP \[bu] 2
 1: All files successfully scanned with some issues.
 .IP \[bu] 2
-2: Some files could not be processed (e.g.\ file not found).
+2: Some files could not be processed (e.g.
+file not found).
 .IP \[bu] 2
-3: ShellCheck was invoked with bad syntax (e.g.\ unknown flag).
+3: ShellCheck was invoked with bad syntax (e.g.
+unknown flag).
 .IP \[bu] 2
-4: ShellCheck was invoked with bad options (e.g.\ unknown formatter).
+4: ShellCheck was invoked with bad options (e.g.
+unknown formatter).
 .SH LOCALE
 .PP
 This version of ShellCheck is only available in English.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/src/ShellCheck/Analytics.hs 
new/ShellCheck-0.6.0/src/ShellCheck/Analytics.hs
--- old/ShellCheck-0.5.0/src/ShellCheck/Analytics.hs    2018-10-15 
18:55:02.000000000 +0200
+++ new/ShellCheck-0.6.0/src/ShellCheck/Analytics.hs    2018-12-03 
04:12:56.000000000 +0100
@@ -432,17 +432,22 @@
 prop_checkShebang5 = verifyTree checkShebang "#!/usr/bin/env ash"
 prop_checkShebang6 = verifyNotTree checkShebang "#!/usr/bin/env ash\n# 
shellcheck shell=dash\n"
 prop_checkShebang7 = verifyNotTree checkShebang "#!/usr/bin/env ash\n# 
shellcheck shell=sh\n"
+prop_checkShebang8 = verifyTree checkShebang "#!bin/sh\ntrue"
+prop_checkShebang9 = verifyNotTree checkShebang "# shellcheck shell=sh\ntrue"
+prop_checkShebang10= verifyNotTree checkShebang "#!foo\n# shellcheck shell=sh 
ignore=SC2239\ntrue"
 checkShebang params (T_Annotation _ list t) =
     if any isOverride list then [] else checkShebang params t
   where
     isOverride (ShellOverride _) = True
     isOverride _ = False
-checkShebang params (T_Script id sb _) = execWriter $
+checkShebang params (T_Script id sb _) = execWriter $ do
     unless (shellTypeSpecified params) $ do
         when (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."
+    unless (null sb || "/" `isPrefixOf` sb) $
+        err id 2239 "Ensure the shebang uses an absolute path to the 
interpreter."
 
 
 prop_checkForInQuoted = verify checkForInQuoted "for f in \"$(ls)\"; do echo 
foo; done"
@@ -1032,13 +1037,16 @@
 
 prop_checkGlobbedRegex1 = verify checkGlobbedRegex "[[ $foo =~ *foo* ]]"
 prop_checkGlobbedRegex2 = verify checkGlobbedRegex "[[ $foo =~ f* ]]"
-prop_checkGlobbedRegex2a = verify checkGlobbedRegex "[[ $foo =~ \\#* ]]"
 prop_checkGlobbedRegex3 = verifyNot checkGlobbedRegex "[[ $foo =~ $foo ]]"
 prop_checkGlobbedRegex4 = verifyNot checkGlobbedRegex "[[ $foo =~ ^c.* ]]"
+prop_checkGlobbedRegex5 = verifyNot checkGlobbedRegex "[[ $foo =~ \\* ]]"
+prop_checkGlobbedRegex6 = verifyNot checkGlobbedRegex "[[ $foo =~ (o*) ]]"
+prop_checkGlobbedRegex7 = verifyNot checkGlobbedRegex "[[ $foo =~ \\*foo ]]"
+prop_checkGlobbedRegex8 = verifyNot checkGlobbedRegex "[[ $foo =~ x\\* ]]"
 checkGlobbedRegex _ (TC_Binary _ DoubleBracket "=~" _ rhs) =
     let s = concat $ oversimplify rhs in
         when (isConfusedGlobRegex s) $
-            warn (getId rhs) 2049 "=~ is for regex. Use == for globs."
+            warn (getId rhs) 2049 "=~ is for regex, but this looks like a 
glob. Use = instead."
 checkGlobbedRegex _ _ = return ()
 
 
@@ -1189,11 +1197,12 @@
 prop_checkComparisonAgainstGlob3 = verify checkComparisonAgainstGlob "[ $cow = 
*foo* ]"
 prop_checkComparisonAgainstGlob4 = verifyNot checkComparisonAgainstGlob "[ 
$cow = foo ]"
 prop_checkComparisonAgainstGlob5 = verify checkComparisonAgainstGlob "[[ $cow 
!= $bar ]]"
+prop_checkComparisonAgainstGlob6 = verify checkComparisonAgainstGlob "[ $f != 
/* ]"
 checkComparisonAgainstGlob _ (TC_Binary _ DoubleBracket op _ (T_NormalWord id 
[T_DollarBraced _ _]))
     | op `elem` ["=", "==", "!="] =
         warn id 2053 $ "Quote the right-hand side of " ++ op ++ " in [[ ]] to 
prevent glob matching."
 checkComparisonAgainstGlob _ (TC_Binary _ SingleBracket op _ word)
-        | (op == "=" || op == "==") && isGlob word =
+        | op `elem` ["=", "==", "!="] && isGlob word =
     err (getId word) 2081 "[ .. ] can't match globs. Use [[ .. ]] or case 
statement."
 checkComparisonAgainstGlob _ _ = return ()
 
@@ -1601,6 +1610,7 @@
 prop_checkSpacefulness33= verifyTree checkSpacefulness "for file; do echo 
$file; done"
 prop_checkSpacefulness34= verifyTree checkSpacefulness "declare foo$n=$1"
 prop_checkSpacefulness35= verifyNotTree checkSpacefulness "echo ${1+\"$1\"}"
+prop_checkSpacefulness36= verifyNotTree checkSpacefulness "arg=$#; echo $arg"
 
 checkSpacefulness params t =
     doVariableFlowAnalysis readF writeF (Map.fromList defaults) (variableFlow 
params)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/src/ShellCheck/Checks/Commands.hs 
new/ShellCheck-0.6.0/src/ShellCheck/Checks/Commands.hs
--- old/ShellCheck-0.5.0/src/ShellCheck/Checks/Commands.hs      2018-10-15 
18:55:02.000000000 +0200
+++ new/ShellCheck-0.6.0/src/ShellCheck/Checks/Commands.hs      2018-12-03 
04:12:56.000000000 +0100
@@ -61,6 +61,7 @@
     ,checkGrepRe
     ,checkTrapQuotes
     ,checkReturn
+    ,checkExit
     ,checkFindExecWithSingleArgument
     ,checkUnusedEchoEscapes
     ,checkInjectableFindSh
@@ -92,6 +93,7 @@
     ,checkWhich
     ,checkSudoRedirect
     ,checkSudoArgs
+    ,checkSourceArgs
     ]
 
 buildCommandMap :: [CommandCheck] -> Map.Map CommandName (Token -> Analysis)
@@ -280,15 +282,28 @@
 prop_checkReturn5 = verify checkReturn "return -1"
 prop_checkReturn6 = verify checkReturn "return 1000"
 prop_checkReturn7 = verify checkReturn "return 'hello world'"
-checkReturn = CommandCheck (Exactly "return") (f . arguments)
+checkReturn = CommandCheck (Exactly "return") (returnOrExit
+        (\c -> err c 2151 "Only one integer 0-255 can be returned. Use stdout 
for other data.")
+        (\c -> err c 2152 "Can only return 0-255. Other data should be written 
to stdout."))
+
+prop_checkExit1 = verifyNot checkExit "exit"
+prop_checkExit2 = verifyNot checkExit "exit 1"
+prop_checkExit3 = verifyNot checkExit "exit $var"
+prop_checkExit4 = verifyNot checkExit "exit $((a|b))"
+prop_checkExit5 = verify checkExit "exit -1"
+prop_checkExit6 = verify checkExit "exit 1000"
+prop_checkExit7 = verify checkExit "exit 'hello world'"
+checkExit = CommandCheck (Exactly "exit") (returnOrExit
+        (\c -> err c 2241 "The exit status can only be one integer 0-255. Use 
stdout for other data.")
+        (\c -> err c 2242 "Can only exit with status 0-255. Other data should 
be written to stdout/stderr."))
+
+returnOrExit multi invalid = (f . arguments)
   where
     f (first:second:_) =
-        err (getId second) 2151
-            "Only one integer 0-255 can be returned. Use stdout for other 
data."
+        multi (getId first)
     f [value] =
         when (isInvalid $ literal value) $
-            err (getId value) 2152
-                "Can only return 0-255. Other data should be written to 
stdout."
+            invalid (getId value)
     f _ = return ()
 
     isInvalid s = s == "" || any (not . isDigit) s || length s > 5
@@ -1008,5 +1023,16 @@
     -- This mess is why ShellCheck prefers not to know.
     parseOpts = getBsdOpts "vAknSbEHPa:g:h:p:u:c:T:r:"
 
+prop_checkSourceArgs1 = verify checkSourceArgs "#!/bin/sh\n. script arg"
+prop_checkSourceArgs2 = verifyNot checkSourceArgs "#!/bin/sh\n. script"
+prop_checkSourceArgs3 = verifyNot checkSourceArgs "#!/bin/bash\n. script arg"
+checkSourceArgs = CommandCheck (Exactly ".") f
+  where
+    f t = whenShell [Sh, Dash] $
+        case arguments t of
+            (file:arg1:_) -> warn (getId arg1) 2240 $
+                "The dot command does not support arguments in sh/dash. Set 
them as variables."
+            _ -> return ()
+
 return []
 runTests =  $( [| $(forAllProperties) (quickCheckWithResult (stdArgs { 
maxSuccess = 1 }) ) |])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/src/ShellCheck/Data.hs 
new/ShellCheck-0.6.0/src/ShellCheck/Data.hs
--- old/ShellCheck-0.5.0/src/ShellCheck/Data.hs 2018-10-15 18:55:02.000000000 
+0200
+++ new/ShellCheck-0.6.0/src/ShellCheck/Data.hs 2018-12-03 04:12:56.000000000 
+0100
@@ -39,7 +39,7 @@
   ]
 
 variablesWithoutSpaces = [
-    "$", "-", "?", "!",
+    "$", "-", "?", "!", "#",
     "BASHPID", "BASH_ARGC", "BASH_LINENO", "BASH_SUBSHELL", "EUID", "LINENO",
     "OPTIND", "PPID", "RANDOM", "SECONDS", "SHELLOPTS", "SHLVL", "UID",
     "COLUMNS", "HISTFILESIZE", "HISTSIZE", "LINES"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/src/ShellCheck/Formatter/TTY.hs 
new/ShellCheck-0.6.0/src/ShellCheck/Formatter/TTY.hs
--- old/ShellCheck-0.5.0/src/ShellCheck/Formatter/TTY.hs        2018-10-15 
18:55:02.000000000 +0200
+++ new/ShellCheck-0.6.0/src/ShellCheck/Formatter/TTY.hs        2018-12-03 
04:12:56.000000000 +0100
@@ -94,7 +94,7 @@
   where
     showErr (_, code, msg) =
         putStrLn $ "  " ++ wikiLink ++ "SC" ++ show code ++ " -- " ++ shorten 
msg
-    limit = 40
+    limit = 36
     shorten msg =
         if length msg < limit
         then msg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/src/ShellCheck/Parser.hs 
new/ShellCheck-0.6.0/src/ShellCheck/Parser.hs
--- old/ShellCheck-0.5.0/src/ShellCheck/Parser.hs       2018-10-15 
18:55:02.000000000 +0200
+++ new/ShellCheck-0.6.0/src/ShellCheck/Parser.hs       2018-12-03 
04:12:56.000000000 +0100
@@ -625,8 +625,8 @@
             readSingleQuoted,
             readDoubleQuoted,
             readDollarExpression,
-            readNormalLiteral "( ",
-            readPipeLiteral,
+            readLiteralForParser $ readNormalLiteral "( ",
+            readLiteralString "|",
             readGlobLiteral
             ]
         readGlobLiteral = do
@@ -636,19 +636,19 @@
             return $ T_Literal id [s]
         readGroup = called "regex grouping" $ do
             start <- startSpan
-            char '('
+            p1 <- readLiteralString "("
             parts <- many (readPart <|> readRegexLiteral)
-            char ')'
+            p2 <- readLiteralString ")"
             id <- endSpan start
-            return $ T_NormalWord id parts
+            return $ T_NormalWord id (p1:(parts ++ [p2]))
         readRegexLiteral = do
             start <- startSpan
             str <- readGenericLiteral1 (singleQuote <|> doubleQuotable <|> 
oneOf "()")
             id <- endSpan start
             return $ T_Literal id str
-        readPipeLiteral = do
+        readLiteralString s = do
             start <- startSpan
-            str <- string "|"
+            str <- string s
             id <- endSpan start
             return $ T_Literal id str
 
@@ -1911,7 +1911,14 @@
     word <- readNormalWord
     return $ T_HereString id word
 
-readNewlineList = many1 ((linefeed <|> carriageReturn) `thenSkip` spacing)
+readNewlineList =
+    many1 ((linefeed <|> carriageReturn) `thenSkip` spacing) <* checkBadBreak
+  where
+    checkBadBreak = optional $ do
+                pos <- getPosition
+                try $ lookAhead (oneOf "|&") --  See if the next thing could 
be |, || or &&
+                parseProblemAt pos ErrorC 1133
+                    "Unexpected start of line. If breaking lines, |/||/&& 
should be at the end of the previous one."
 readLineBreak = optional readNewlineList
 
 prop_readSeparator1 = isWarning readScript "a &; b"
@@ -2300,7 +2307,7 @@
     allspacing
     list <- readCompoundList
     allspacing
-    char ')' <|> fail ") closing the subshell"
+    char ')' <|> fail "Expected ) closing the subshell"
     id <- endSpan start
     return $ T_Subshell id list
 
@@ -2654,6 +2661,13 @@
   where
     readUntil endPos = anyChar `reluctantlyTill` (getPosition >>= guard . (== 
endPos))
 
+-- Like readStringForParser, returning the span as a T_Literal
+readLiteralForParser parser = do
+    start <- startSpan
+    str <- readStringForParser parser
+    id <- endSpan start
+    return $ T_Literal id str
+
 prop_readAssignmentWord = isOk readAssignmentWord "a=42"
 prop_readAssignmentWord2 = isOk readAssignmentWord "b=(1 2 3)"
 prop_readAssignmentWord3 = isWarning readAssignmentWord "$b = 13"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ShellCheck-0.5.0/striptests 
new/ShellCheck-0.6.0/striptests
--- old/ShellCheck-0.5.0/striptests     1970-01-01 01:00:00.000000000 +0100
+++ new/ShellCheck-0.6.0/striptests     2018-12-03 04:12:56.000000000 +0100
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+# This file strips all unit tests from ShellCheck, removing
+# the dependency on QuickCheck and Template Haskell and
+# reduces the binary size considerably.
+set -o pipefail
+
+sponge() {
+  local data
+  data="$(cat)"
+  printf '%s\n' "$data" > "$1"
+}
+
+modify() {
+  if ! "${@:2}" < "$1" | sponge "$1"
+  then
+    {
+      printf 'Failed to modify %s: ' "$1"
+      printf '%q ' "${@:2}"
+      printf '\n'
+    } >&2
+    exit 1
+  fi
+}
+
+detestify() {
+  printf '%s\n' '-- AUTOGENERATED from ShellCheck by striptests. Do not 
modify.'
+  awk '
+    BEGIN {
+      state = 0;
+    }
+
+    /LANGUAGE TemplateHaskell/ { next; }
+    /^import.*Test\./ { next; }
+
+    /^module/ {
+      sub(/,[^,)]*runTests/, "");
+    }
+
+    # Delete tests
+    /^prop_/ { state = 1; next; }
+
+    # ..and any blank lines following them.
+    state == 1 && /^ / { next; }
+
+    # Template Haskell marker
+    /^return / {
+      exit;
+    }
+
+    { state = 0; print; }
+    '
+}
+
+
+
+if [[ ! -e 'ShellCheck.cabal' ]]
+then
+  echo "Run me from the ShellCheck directory." >&2
+  exit 1
+fi
+
+if [[ -d '.git' ]] && ! git diff --exit-code > /dev/null 2>&1
+then
+  echo "You have local changes! These may be overwritten." >&2
+  exit 2
+fi
+
+modify 'ShellCheck.cabal' sed -e '
+  /QuickCheck/d
+  /^test-suite/{ s/.*//; q; }
+  '
+
+find . -name '.git' -prune -o -type f -name '*.hs' -print |
+  while IFS= read -r file
+  do
+    modify "$file" detestify
+  done
+


Reply via email to