Skip to content

Reduce cabal init field offset formatting by one space. #6690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/Init/FileCreators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ generateCabalFile fileName c = trimTrailingWS $
(False, _, _) -> ($$ text "")
$
comment f <<>> text s <<>> colon
<<>> text (replicate (20 - length s) ' ')
<<>> text (replicate (19 - length s) ' ')
<<>> text (fromMaybe "" . flagToMaybe $ f)
comment NoFlag = text "-- "
comment (Flag "") = text "-- "
Expand Down
28 changes: 14 additions & 14 deletions tests/fixtures/init/exe-only-golden.cabal
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
cabal-version: 2.4
name: foo
version: 3.2.1
synopsis: The foo package
homepage: https://github.com/foo/foo
license: NONE
author: me
maintainer: me@me.me
category: SomeCat
extra-source-files: CHANGELOG.md
cabal-version: 2.4
name: foo
version: 3.2.1
synopsis: The foo package
homepage: https://github.com/foo/foo
license: NONE
author: me
maintainer: me@me.me
category: SomeCat
extra-source-files: CHANGELOG.md

executable foo
main-is: Main.hs
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0
hs-source-dirs: app
default-language: Haskell2010
main-is: Main.hs
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0
hs-source-dirs: app
default-language: Haskell2010
46 changes: 23 additions & 23 deletions tests/fixtures/init/lib-exe-and-test-golden.cabal
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
cabal-version: 2.4
name: foo
version: 3.2.1
synopsis: The foo package
homepage: https://github.com/foo/foo
license: NONE
author: me
maintainer: me@me.me
category: SomeCat
extra-source-files: CHANGELOG.md
cabal-version: 2.4
name: foo
version: 3.2.1
synopsis: The foo package
homepage: https://github.com/foo/foo
license: NONE
author: me
maintainer: me@me.me
category: SomeCat
extra-source-files: CHANGELOG.md

library
exposed-modules: A, B
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0
hs-source-dirs: src
default-language: Haskell2010
exposed-modules: A, B
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0
hs-source-dirs: src
default-language: Haskell2010

executable foo
main-is: Main.hs
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0
hs-source-dirs: app
default-language: Haskell2010
main-is: Main.hs
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0
hs-source-dirs: app
default-language: Haskell2010

test-suite foo-test
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: MyLibTest.hs
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: MyLibTest.hs
build-depends: base ^>=4.13.0.0, containers ^>=5.7.0.0, unordered-containers ^>=2.7.0.0