Skip to content

Commit

Permalink
Merge pull request #140 from phadej/default-language
Browse files Browse the repository at this point in the history
Use default-language of the component
  • Loading branch information
phadej authored Dec 18, 2023
2 parents e22c584 + f1ba31b commit 6f92f03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cabal-docspec/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.0.0.202312dd

- Pass `default-language` flag to GHC

# 0.0.0.20230406

- Change failing docspec output to be proper diff.
Expand Down
8 changes: 7 additions & 1 deletion cabal-docspec/src/CabalDocspec/Opts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ data Phase
-- TODO: take tracer
dynOptsFromBuildInfo :: TracerPeu r Tr -> C.BuildInfo -> Peu r (DynOpts -> DynOpts)
dynOptsFromBuildInfo tracer bi = do
let lang = case C.defaultLanguage bi of
Nothing -> id
Just l -> \dynOpts -> dynOpts
{ optExts = prettyShow l : optExts dynOpts
}

endos <- for customFields (uncurry parse)
return $ \x -> foldl' (&) x endos
return $ \x -> foldl' (&) x (lang : endos)
where
customFields = C.customFieldsBI bi

Expand Down

0 comments on commit 6f92f03

Please sign in to comment.