Added a json interface

This commit is contained in:
Vidar Holen
2012-11-06 21:55:46 -08:00
parent 9ca7d57780
commit 7e3a20c14a
2 changed files with 20 additions and 1 deletions

15
jsoncheck.hs Normal file
View File

@@ -0,0 +1,15 @@
import ShellCheck.Simple
import Text.JSON
instance JSON ShellCheckComment where
showJSON c = makeObj [
("line", showJSON $ scLine c),
("column", showJSON $ scColumn c),
("level", showJSON $ scSeverity c),
("message", showJSON $ scMessage c)
]
readJSON = undefined
main = do
script <- getContents
putStrLn $ encodeStrict $ shellCheck script