Skip to content

cabal format inlines and removes common stanzas #5734

Open
@m-renaud

Description

@m-renaud

Overview

When running cabal format, all common stanzas are inlined into the blocks they're referenced from.

Example

Before:

cabal-version: 2.4
name: inittest
version: 0.1.0.0
build-type: Simple

common common-deps
    default-language: Haskell2010
    build-depends: base >=4.12 && <4.13

library
    import: common-deps
    exposed-modules:
        MyLib
    hs-source-dirs: src

executable inittest
    import: common-deps
    main-is: Main.hs
    hs-source-dirs: app
    build-depends:
        inittest -any

After:

cabal-version: 2.4
name: inittest
version: 0.1.0.0
build-type: Simple

library
    exposed-modules:
        MyLib
    hs-source-dirs: src
    default-language: Haskell2010
    build-depends:
        base >=4.12 && <4.13

executable inittest
    main-is: Main.hs
    hs-source-dirs: app
    default-language: Haskell2010
    build-depends:
        base >=4.12 && <4.13,
        inittest -any

/cc @phadej @hvr

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions