cabal-gild: Format .cabal files

[ development, library, mit, program ] [ Propose Tags ]

Format .cabal files preserving the original field ordering, and comments.

Tuned for Oleg's preference, but has some knobs still.


[Skip to Readme]

Modules

[Last Documentation]

  • CabalGild
    • CabalGild.Comments
    • CabalGild.Error
    • CabalGild.Fields
      • CabalGild.Fields.BuildDepends
      • CabalGild.Fields.Extensions
      • CabalGild.Fields.Modules
      • CabalGild.Fields.SourceFiles
      • CabalGild.Fields.TestedWith
    • CabalGild.FreeText
    • CabalGild.Glob
    • CabalGild.Main
    • CabalGild.Monad
    • CabalGild.Options
    • CabalGild.Parser
    • CabalGild.Pragma
    • CabalGild.Prelude
    • CabalGild.Refactoring
      • CabalGild.Refactoring.ExpandExposedModules
      • CabalGild.Refactoring.Fragments
      • CabalGild.Refactoring.GlobFiles
      • CabalGild.Refactoring.Type
  • VersionInterval

Flags

Manual Flags

NameDescriptionDefault
pedanticDisabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.1, 0.2.1.0, 0.2.1.1, 0.3.0.0, 0.3.0.1, 1.0.0.0, 1.0.0.1, 1.0.1.0, 1.0.2.0, 1.0.2.1, 1.0.2.2, 1.0.2.3, 1.0.2.4, 1.1.0.0, 1.1.0.1, 1.1.1.0, 1.1.2.0, 1.1.3.0, 1.1.4.0, 1.2.0.0, 1.3.0.0, 1.3.0.1, 1.3.1.0
Change log CHANGELOG.md
Dependencies base (>=4.17.2.1 && <4.18 || >=4.18.2.0 && <4.19 || >=4.19.0.0 && <4.20), bytestring (>=0.11.5.3 && <0.12 || >=0.12.0.2 && <0.13), cabal-gild, Cabal-syntax (>=3.8.1.0 && <3.9 || >=3.10.1.0 && <3.11), containers (>=0.6.7 && <0.7), directory (>=1.3.7.1 && <1.4), filepath (>=1.4.2.2 && <1.5), mtl (>=2.2.2 && <2.3 || >=2.3.1 && <2.4), optparse-applicative (>=0.18.1.0 && <0.19), parsec (>=3.1.16.1 && <3.2), pretty (>=1.1.3.6 && <1.2) [details]
License GPL-3.0-or-later AND BSD-3-Clause
Author Oleg Grenrus <oleg.grenrus@iki.fi>
Maintainer Taylor Fausak
Category Development
Source repo head: git clone https://github.com/tfausak/cabal-gild
Uploaded by fozworth at 2024-01-29T14:21:53Z
Distributions NixOS:1.3.0.1, Stackage:1.3.1.0
Executables cabal-gild
Downloads 531 total (91 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2024-01-29 [all 2 reports]

Readme for cabal-gild-0.2.1.0

[back to package description]

cabal-gild

Synopsis

$ cabal install cabal-gild
$ ...
$ cabal-gild --inplace example.cabal

Output

Turns this...

cabal-version: 2.4
name: cabal-gild
version: 0

-- An example formatter
executable cabal-gild
    default-language: Haskell2010
    hs-source-dirs: src
    main-is: CabalGild.hs
    -- build depends will be in
    -- a nice tabular format
    build-depends: base >=4.11 && <4.13, pretty >=1.1.3.6 && <1.2, bytestring, Cabal ^>=2.5, containers ^>=0.5.11.0 || ^>=0.6.0.1
    -- extensions will be sorted
    other-extensions:
      DeriveFunctor FlexibleContexts ExistentialQuantification OverloadedStrings
      RankNTypes

...into this:

cabal-version: 2.4
name:          cabal-gild
version:       0

-- An example formatter
executable cabal-gild
  default-language: Haskell2010
  hs-source-dirs:   src
  main-is:          CabalGild.hs

  -- build depends will be in
  -- a nice tabular format
  build-depends:
    , base        >=4.11      && <4.13
    , bytestring
    , Cabal       ^>=2.5
    , containers  ^>=0.5.11.0 || ^>=0.6.0.1
    , pretty      >=1.1.3.6   && <1.2

  -- extensions will be sorted
  other-extensions:
    DeriveFunctor
    ExistentialQuantification
    FlexibleContexts
    OverloadedStrings
    RankNTypes