Renamed much of the ShellCheck.Simple interface

This commit is contained in:
Vidar Holen
2012-11-06 13:26:25 -08:00
parent e264f64266
commit 9ca7d57780
2 changed files with 11 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
module ShellCheck.Simple (shellcheckCheck, ShellCheckComment, shellcheckLine, shellcheckColumn, shellcheckSeverity, shellcheckComment) where
module ShellCheck.Simple (shellCheck, ShellCheckComment, scLine, scColumn, scSeverity, scMessage) where
import ShellCheck.Parser
import ShellCheck.Analytics
@@ -6,8 +6,8 @@ import Data.Maybe
import Text.Parsec.Pos
import Data.List
shellcheckCheck :: String -> [ShellCheckComment]
shellcheckCheck script =
shellCheck :: String -> [ShellCheckComment]
shellCheck script =
let (ParseResult result notes) = parseShell "-" script in
let allNotes = notes ++ (concat $ maybeToList $ do
(tree, map) <- result
@@ -17,11 +17,11 @@ shellcheckCheck script =
in
map formatNote $ nub $ sortNotes allNotes
data ShellCheckComment = ShellCheckComment { shellcheckLine :: Int, shellcheckColumn :: Int, shellcheckSeverity :: String, shellcheckComment :: String }
data ShellCheckComment = ShellCheckComment { scLine :: Int, scColumn :: Int, scSeverity :: String, scMessage :: String }
instance Show ShellCheckComment where
show c = concat ["(", show $ shellcheckLine c, ",", show $ shellcheckColumn c, ") ", shellcheckSeverity c, ": ", shellcheckComment c]
show c = concat ["(", show $ scLine c, ",", show $ scColumn c, ") ", scSeverity c, ": ", scMessage c]
severityToString s =
case s of