diff --git a/ShellCheck/Simple.hs b/ShellCheck/Simple.hs index 7c7a5ff..c7adb7b 100644 --- a/ShellCheck/Simple.hs +++ b/ShellCheck/Simple.hs @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -} -module ShellCheck.Simple (shellCheck, ShellCheckComment, scLine, scColumn, scSeverity, scMessage) where +module ShellCheck.Simple (shellCheck, ShellCheckComment, scLine, scColumn, scSeverity, scCode, scMessage) where import ShellCheck.Parser import ShellCheck.Analytics diff --git a/jsoncheck.hs b/jsoncheck.hs index 8410eed..5996f46 100644 --- a/jsoncheck.hs +++ b/jsoncheck.hs @@ -23,6 +23,7 @@ instance JSON ShellCheckComment where ("line", showJSON $ scLine c), ("column", showJSON $ scColumn c), ("level", showJSON $ scSeverity c), + ("code", showJSON $ scCode c), ("message", showJSON $ scMessage c) ] readJSON = undefined diff --git a/shellcheck.hs b/shellcheck.hs index b06ddec..2e24e53 100644 --- a/shellcheck.hs +++ b/shellcheck.hs @@ -66,7 +66,9 @@ doInput filename contents colorFunc = do return $ null comments cuteIndent comment = - (replicate ((scColumn comment) - 1) ' ') ++ "^-- " ++ (scMessage comment) + (replicate ((scColumn comment) - 1) ' ') ++ "^-- " ++ (code $ scCode comment) ++ ": " ++ (scMessage comment) + +code code = "SC" ++ (show code) getColorFunc = do term <- hIsTerminalDevice stdout