From e59603a04a7da37fc0a20caa838ffecbd4f85fbb Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 30 Dec 2020 16:30:08 -0800 Subject: [PATCH] ;check errors: drop unwanted newline & "strict mode" prefix --- hledger-lib/Hledger/Read/Common.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hledger-lib/Hledger/Read/Common.hs b/hledger-lib/Hledger/Read/Common.hs index 4c822f883..b1e0f757e 100644 --- a/hledger-lib/Hledger/Read/Common.hs +++ b/hledger-lib/Hledger/Read/Common.hs @@ -377,7 +377,7 @@ journalCheckPayeesDeclared j = sequence_ $ map checkpayee $ jtxns j checkpayee t | p `elem` ps = Right () | otherwise = - Left $ "\nundeclared payee \""++T.unpack p++"\"" + Left $ "undeclared payee \""++T.unpack p++"\"" ++ "\nin transaction at: "++showGenericSourcePos (tsourcepos t) where p = transactionPayee t @@ -391,7 +391,7 @@ journalCheckAccountsDeclared j = sequence_ $ map checkacct $ journalPostings j checkacct Posting{paccount,ptransaction} | paccount `elem` as = Right () | otherwise = - Left $ "\nstrict mode: undeclared account \""++T.unpack paccount++"\"" + Left $ "undeclared account \""++T.unpack paccount++"\"" ++ case ptransaction of Just Transaction{tsourcepos} -> "\nin transaction at: "++showGenericSourcePos tsourcepos Nothing -> "" @@ -407,8 +407,7 @@ journalCheckCommoditiesDeclared j = checkcommodities Posting{..} = case mfirstundeclaredcomm of Nothing -> Right () - Just c -> Left $ - "\nstrict mode: undeclared commodity \""++T.unpack c++"\"" + Just c -> Left $ "undeclared commodity \""++T.unpack c++"\"" ++ case ptransaction of Just Transaction{tsourcepos} -> "\nin transaction at: "++showGenericSourcePos tsourcepos Nothing -> ""