diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-09-17 10:55:00 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-19 15:51:07 -0400 |
commit | 885ecd18e084e4e2b15fbc5de0aa5222f2573387 (patch) | |
tree | 89c22f74dd9613975e79f3d05a7989be24ea0cb7 | |
parent | 4df3aa956260e3d84232f43546e297cf425081dd (diff) | |
download | haskell-885ecd18e084e4e2b15fbc5de0aa5222f2573387.tar.gz |
hadrian: Fail on Sphinx syntax errors
Specifically the "Inline literal start-string without end-string"
warning, which typically means that the user neglected to separate
an inline code block from suffix text with a backslash.
-rw-r--r-- | hadrian/src/Rules/Documentation.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs index f39d52c512..6898fd12e5 100644 --- a/hadrian/src/Rules/Documentation.hs +++ b/hadrian/src/Rules/Documentation.hs @@ -127,6 +127,21 @@ checkSphinxWarnings :: FilePath -- ^ output directory -> Action () checkSphinxWarnings out = do log <- liftIO $ readFile (out -/- ".log") + when ("Inline literal start-string without end-string." `isInfixOf` log) + $ fail $ unlines + [ "Syntax error found in Sphinx log. " + , "" + , "This likely means that you have forgotten a \\ after inline code block. For instance," + , "you might have written:" + , "" + , " are not allowed to contain nested ``forall``s." + , "" + , "Whereas you need to write:" + , "" + , " are not allowed to contain nested ``forall``\\s." + , "" + ] + when ("reference target not found" `isInfixOf` log) $ fail "Undefined reference targets found in Sphinx log." |