1
1
mirror of https://github.com/google/ormolu.git synced 2024-12-02 23:43:34 +03:00

Mention name of file even when rendered version fails to parse

Without this info it's hard to know which file from a bulk is problematic.
This commit is contained in:
mrkkrp 2019-07-07 13:43:59 +02:00 committed by Mark Karpov
parent d82d607b3a
commit d63eeea3df

View File

@ -60,7 +60,11 @@ ormolu cfg path str = do
-- same as AST of original snippet module span positions.
unless (cfgUnsafe cfg) $ do
(_, result1) <-
parseModule' cfg OrmoluOutputParsingFailed "<rendered>" (T.unpack txt)
parseModule'
cfg
OrmoluOutputParsingFailed
(path ++ "<rendered>")
(T.unpack txt)
when (diff result0 result1) $
liftIO $ throwIO (OrmoluASTDiffers str txt)
return txt