Added a json interface
This commit is contained in:
parent
9ca7d57780
commit
7e3a20c14a
6
Makefile
6
Makefile
|
@ -1,10 +1,14 @@
|
|||
all: shellcheck .tests
|
||||
all: shellcheck jsoncheck .tests
|
||||
: Done
|
||||
|
||||
shellcheck: regardless
|
||||
: Conditionally compiling shellcheck
|
||||
ghc --make shellcheck
|
||||
|
||||
jsoncheck: regardless
|
||||
: Conditionally compiling shellcheck
|
||||
ghc --make jsoncheck
|
||||
|
||||
.tests: *.hs */*.hs
|
||||
: Running unit tests
|
||||
./test/runQuack && touch .tests
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue