From efb64e0228c19ef7936446d3ca14a7d7a6e2540b Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 28 Nov 2021 22:24:30 +0100 Subject: various fixes to bugs Among them - always set correct exit codes - refuse to write out files if the out path already exists - calculate the overall severity correctly - slightly changed the json output schema - also output the text output format in json - make the default config.json suitable for a production environment --- lib/Types.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Types.hs') diff --git a/lib/Types.hs b/lib/Types.hs index 0d35432..1099630 100644 --- a/lib/Types.hs +++ b/lib/Types.hs @@ -84,8 +84,7 @@ instance PrettyPrint Hint where prettyprint (Hint level msg) = " " <> (showText level) <> ": " <> msg instance ToJSON Lint where - toJSON (Lint (Hint l m)) = A.object - [ "msg" .= m, "level" .= l ] + toJSON (Lint h) = toJSON h toJSON (Depends dep) = A.object [ "msg" .= prettyprint dep , "level" .= A.String "Dependency Info" ] @@ -93,6 +92,10 @@ instance ToJSON Lint where [ "msg" .= prettyprint l , "level" .= A.String "Entrypoint Info" ] +instance ToJSON Hint where + toJSON (Hint l m) = A.object + [ "msg" .= m, "level" .= l ] + instance ToJSON Dep where toJSON = \case Local text -> json "local" $ prettyprint text -- cgit v1.2.3