packages feed

cabal-fmt-0.1: cabal-fmt.cabal

cabal-version:      2.2
name:               cabal-fmt
version:            0.1
synopsis:           Format .cabal files
category:           Development
description:
  Format @.cabal@ files preserving the original ordering and comments.
  .
  Tuned for Oleg's preference, but has some knobs still.

license:            GPL-3.0-or-later
license-file:       LICENSE
author:             Oleg Grenrus <oleg.grenrus@iki.fi>
maintainer:         Oleg Grenrus <oleg.grenrus@iki.fi>
tested-with:        GHC ==8.4.4 || ==8.6.5
extra-source-files:
  fixtures/*.cabal
  fixtures/*.format

source-repository head
  type:     git
  location: https://github.com/phadej/cabal-fmt.git

library cabal-fmt-internal
  default-language: Haskell2010
  hs-source-dirs:   src

  -- GHC boot libraries
  build-depends:
    , base        ^>=4.11.1.0 || ^>=4.12.0.0
    , bytestring  ^>=0.10.8.2
    , Cabal       ^>=3.0.0.0
    , containers  ^>=0.5.11.0 || ^>=0.6.0.1
    , filepath    ^>=1.4.2
    , mtl         ^>=2.2.2
    , parsec      ^>=3.1.13.0
    , pretty      ^>=1.1.3.6

  -- cabal-fmt: expand src
  --
  -- Note: the module list is expanded only when cabal-fmt is run from a
  -- command line, with a single file. This is to get right relative
  -- working directory.
  --
  exposed-modules:
    CabalFmt
    CabalFmt.Comments
    CabalFmt.Error
    CabalFmt.Fields
    CabalFmt.Fields.BuildDepends
    CabalFmt.Fields.Extensions
    CabalFmt.Fields.Modules
    CabalFmt.Fields.TestedWith
    CabalFmt.Monad
    CabalFmt.Options
    CabalFmt.Parser
    CabalFmt.Refactoring

  other-extensions:
    DeriveFunctor
    DerivingStrategies
    ExistentialQuantification
    FlexibleContexts
    GeneralizedNewtypeDeriving
    OverloadedStrings
    RankNTypes

executable cabal-fmt
  default-language: Haskell2010
  hs-source-dirs:   cli
  main-is:          Main.hs

  -- dependencies in library
  build-depends:
    , base
    , bytestring
    , cabal-fmt-internal
    , filepath

  -- extra dependencies
  build-depends:
    , directory             ^>=1.3.1.5
    , optparse-applicative  >=0.14.3.0 && <0.16

test-suite golden
  type:             exitcode-stdio-1.0
  default-language: Haskell2010
  hs-source-dirs:   tests
  main-is:          Golden.hs

  -- dependencies in library
  build-depends:
    , base
    , bytestring
    , Cabal
    , cabal-fmt-internal

  -- test dependencies
  build-depends:
    , filepath
    , process
    , tasty
    , tasty-golden