1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 21:16:12 +03:00

Newline on end of JSON output, no longer pretty

This commit is contained in:
Timothy Clem 2017-03-08 13:26:20 -08:00
parent a62b720dad
commit 58889e1038

View File

@ -3,8 +3,7 @@ module ParseCommand where
import Arguments
import Category
import Data.Aeson (ToJSON)
import Data.Aeson.Encode.Pretty
import Data.Aeson (ToJSON, encode)
import Data.Record
import qualified Data.Text as T
import qualified Data.ByteString as B
@ -44,7 +43,7 @@ parse Arguments{..} = do
parsers = parserWithSource <$> filePaths
toByteString terms = case format of
SExpression -> printTerms TreeOnly terms
_ -> B.intercalate "\n" (toS . encodePretty . cata algebra <$> terms)
_ -> B.intercalate "\n" (toS . encode . cata algebra <$> terms) <> "\n"
algebra :: TermF (Syntax leaf) (Record '[SourceText, Range, Category, SourceSpan]) ParseJSON -> ParseJSON
algebra term = case term of