`cabal init` may use `common` stanza when choosing "Library and Executable" and version 2.2 or higher.
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Currently, a generated cabal file would look something like this:
cabal-version: 2.4
-- Initial package description 'x2.cabal' generated by 'cabal init'. For
-- further documentation, see http://haskell.org/cabal/users-guide/
name: x2
...
library
-- exposed-modules:
-- other-modules:
-- other-extensions:
build-depends: base ^>=4.12.0.0
hs-source-dirs: src
default-language: Haskell2010
executable x2
main-is: Main.hs
-- other-modules:
-- other-extensions:
build-depends: base ^>=4.12.0.0
hs-source-dirs: src
default-language: Haskell2010
Surely `build-depends`, `hs-source-dirs` and `default-language` could be moved to a common stanza?
Contributor guide
Research direction
Inspect the `cabal init` generation path, focusing on the Library and Executable selection for cabal-version 2.2 or higher. Compare the generated sections with the issue's example; done means shared `build-depends`, `hs-source-dirs`, and `default-language` settings are emitted through a `common` stanza.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100