From 7f5f5b7fb5be87cb73970ba695d57e2517ab6b2f Mon Sep 17 00:00:00 2001 From: Russell Harmon Date: Sat, 18 Jun 2016 14:59:47 -0700 Subject: [PATCH] Make SC1035 emit a proper end column Example JSON output: ``` $ shellcheck -s bash -f json /dev/stdin <<< "[[0 -eq 1 ]]" [{"file":"/tmp/zshNCNwPz","line":1,"column":1,"endColumn":3,"level":"error","code":1035,"message":"You need a space after the [[ and before the ]]."}] ``` --- ShellCheck/Parser.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index 6d875ee..ad0cc35 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -814,7 +814,7 @@ readCondition = called "test expression" $ do pos <- getPosition space <- allspacing when (null space) $ - parseProblemAt pos ErrorC 1035 $ "You need a space after the " ++ + parseProblemAtWithEnd opos pos ErrorC 1035 $ "You need a space after the " ++ if single then "[ and before the ]." else "[[ and before the ]]."