Skip to content

Commit 269c117

Browse files
KleidukosCopilot
authored andcommitted
Rework common stanzas in the cabal file generated by cabal init (haskell#11261)
* Reword common stanzas in the cabal file generated by `cabal init` Following haskell#11231, this commit reworks the common stanzas present in the cabal file generated by `cabal init`. * Accept golden tests * Don't insert rts options stanza imports for library * Remove old common stanza * Update golden tests * Remove tests/fixtures from .gitignore * Initial plan * Remove -T and -Wcompat from the default flags --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 370001d commit 269c117

27 files changed

Lines changed: 447 additions & 238 deletions

cabal-install/src/Distribution/Client/Init/FileCreators.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,17 @@ writeProject (ProjectSettings opts pkgDesc libTarget exeTarget testTarget)
7474
writeReadme opts pkgDesc
7575

7676
let pkgFields = mkPkgDescription opts pkgDesc
77-
commonStanza = mkCommonStanza opts
77+
extensionsStanza = mkExtensionsStanza opts
78+
ghcOptionsStanza = mkGhcOptionsStanza opts
79+
rtsOptionsStanza = mkRtsOptionsStanza opts
7880

7981
libStanza <- prepareLibTarget opts libTarget
8082
exeStanza <- prepareExeTarget opts exeTarget
8183
testStanza <- prepareTestTarget opts testTarget
8284

8385
(reusedCabal, cabalContents) <-
8486
writeCabalFile opts $
85-
pkgFields ++ [commonStanza, libStanza, exeStanza, testStanza]
87+
pkgFields ++ [extensionsStanza, ghcOptionsStanza, rtsOptionsStanza, libStanza, exeStanza, testStanza]
8688

8789
when (null $ _pkgSynopsis pkgDesc) $
8890
message opts T.Warning "No synopsis given. You should edit the .cabal file and add one."

0 commit comments

Comments
 (0)