Skip to content
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

Format .cabal files with cabal-gild #1130

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Apply cabal-gild
amesgen committed Jul 9, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 150a72eaeb414fa8d74ed39e167380a250d9bc3f
51 changes: 28 additions & 23 deletions extract-hackage-info/extract-hackage-info.cabal
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
cabal-version: 2.4
name: extract-hackage-info
version: 0.0.0.0
maintainer: Thomas Bagrel <thomas.bagrel@tweag.io>
author: Thomas Bagrel <thomas.bagrel@tweag.io>
name: extract-hackage-info
version: 0.0.0.0
maintainer: Thomas Bagrel <thomas.bagrel@tweag.io>
author: Thomas Bagrel <thomas.bagrel@tweag.io>

executable extract-hackage-info
main-is: Main.hs
hs-source-dirs: src
other-modules: Hoogle
default-language: GHC2021
ghc-options: -O2 -Wall -rtsopts -Wunused-packages
build-depends:
Cabal-syntax >=3.12 && <3.13,
aeson >=2.2 && <3,
base >=4.12 && <5,
binary >=0.8 && <0.9,
bytestring >=0.10 && <0.13,
containers >=0.6 && <0.8,
directory >=1 && <2,
filepath >=1.2 && <1.6,
optparse-applicative >=0.14 && <0.19,
ormolu,
text >=2.1 && <3,
formatting >=7.1 && <7.3,
megaparsec >=9
main-is: Main.hs
hs-source-dirs: src
other-modules: Hoogle
default-language: GHC2021
ghc-options:
-O2
-Wall
-rtsopts
-Wunused-packages

build-depends:
Cabal-syntax >=3.12 && <3.13,
aeson >=2.2 && <3,
base >=4.12 && <5,
binary >=0.8 && <0.9,
bytestring >=0.10 && <0.13,
containers >=0.6 && <0.8,
directory >=1 && <2,
filepath >=1.2 && <1.6,
formatting >=7.1 && <7.3,
megaparsec >=9,
optparse-applicative >=0.14 && <0.19,
ormolu,
text >=2.1 && <3,
8 changes: 4 additions & 4 deletions fixity-tests/dummy.cabal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cabal-version: 2.4
name: dummy
version: 0.0.0.0
license: BSD-3-Clause
cabal-version: 2.4
name: dummy
version: 0.0.0.0
license: BSD-3-Clause
45 changes: 24 additions & 21 deletions ormolu-live/ormolu-live.cabal
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
cabal-version: 3.0
name: ormolu-live
version: 0.0.0.0
maintainer: Alexander Esgen <alexander.esgen@tweag.io>
author: Alexander Esgen <alexander.esgen@tweag.io>
name: ormolu-live
version: 0.0.0.0
maintainer: Alexander Esgen <alexander.esgen@tweag.io>
author: Alexander Esgen <alexander.esgen@tweag.io>

executable ormolu-live
main-is: Main.hs
c-sources: cbits/init.c
hs-source-dirs: app
default-language: GHC2021
ghc-options:
-Wall -Wunused-packages -no-hs-main -optl-mexec-model=reactor
"-optl-Wl,--export=malloc,--export=mallocPtr,--export=free,--export=formatRaw"
main-is: Main.hs
c-sources: cbits/init.c
hs-source-dirs: app
default-language: GHC2021
ghc-options:
-Wall
-Wunused-packages
-no-hs-main
-optl-mexec-model=reactor
"-optl-Wl,--export=malloc,--export=mallocPtr,--export=free,--export=formatRaw"

build-depends:
base,
ormolu,
bytestring,
text,
containers,
aeson,
ghc-lib-parser,
Cabal-syntax,
deepseq
build-depends:
Cabal-syntax,
aeson,
base,
bytestring,
containers,
deepseq,
ghc-lib-parser,
ormolu,
text,
384 changes: 201 additions & 183 deletions ormolu.cabal
Original file line number Diff line number Diff line change
@@ -1,199 +1,217 @@
cabal-version: 2.4
name: ormolu
version: 0.7.7.0
license: BSD-3-Clause
license-file: LICENSE.md
maintainer: Mark Karpov <mark.karpov@tweag.io>
tested-with: ghc ==9.6.5 ghc ==9.8.2 ghc ==9.10.1
homepage: https://github.com/tweag/ormolu
bug-reports: https://github.com/tweag/ormolu/issues
synopsis: A formatter for Haskell source code
description: A formatter for Haskell source code.
category: Development, Formatting
build-type: Simple
cabal-version: 2.4
name: ormolu
version: 0.7.7.0
license: BSD-3-Clause
license-file: LICENSE.md
maintainer: Mark Karpov <mark.karpov@tweag.io>
tested-with:
ghc ==9.6.5
ghc ==9.8.2
ghc ==9.10.1

homepage: https://github.com/tweag/ormolu
bug-reports: https://github.com/tweag/ormolu/issues
synopsis: A formatter for Haskell source code
description: A formatter for Haskell source code.
category: Development, Formatting
build-type: Simple
extra-source-files:
data/**/*.hs
data/**/*.txt
data/**/*.cabal
extract-hackage-info/hackage-info.bin
data/**/*.cabal
data/**/*.hs
data/**/*.txt
extract-hackage-info/hackage-info.bin

extra-doc-files:
CONTRIBUTING.md
CHANGELOG.md
DESIGN.md
README.md
CHANGELOG.md
CONTRIBUTING.md
DESIGN.md
README.md

source-repository head
type: git
location: https://github.com/tweag/ormolu.git
type: git
location: https://github.com/tweag/ormolu.git

flag dev
description: Turn on development settings.
default: False
manual: True
description: Turn on development settings.
default: False
manual: True

flag internal-bundle-fixities
description:
An internal ad-hoc flag that is enabled by default, Ormolu Live disables
it due to missing WASM TH support.
description:
An internal ad-hoc flag that is enabled by default, Ormolu Live disables
it due to missing WASM TH support.

manual: True
manual: True

library
exposed-modules:
Ormolu
Ormolu.Config
Ormolu.Diff.ParseResult
Ormolu.Diff.Text
Ormolu.Exception
Ormolu.Imports
Ormolu.Parser
Ormolu.Parser.CommentStream
Ormolu.Parser.Pragma
Ormolu.Parser.Result
Ormolu.Printer
Ormolu.Printer.Combinators
Ormolu.Printer.Comments
Ormolu.Printer.Internal
Ormolu.Printer.Meat.Common
Ormolu.Printer.Meat.Declaration
Ormolu.Printer.Meat.Declaration.Annotation
Ormolu.Printer.Meat.Declaration.Class
Ormolu.Printer.Meat.Declaration.Data
Ormolu.Printer.Meat.Declaration.Default
Ormolu.Printer.Meat.Declaration.Foreign
Ormolu.Printer.Meat.Declaration.Instance
Ormolu.Printer.Meat.Declaration.RoleAnnotation
Ormolu.Printer.Meat.Declaration.Rule
Ormolu.Printer.Meat.Declaration.Signature
Ormolu.Printer.Meat.Declaration.Splice
Ormolu.Printer.Meat.Declaration.Type
Ormolu.Printer.Meat.Declaration.TypeFamily
Ormolu.Printer.Meat.Declaration.Value
Ormolu.Printer.Meat.Declaration.OpTree
Ormolu.Printer.Meat.Declaration.Warning
Ormolu.Printer.Meat.ImportExport
Ormolu.Printer.Meat.Module
Ormolu.Printer.Meat.Pragma
Ormolu.Printer.Meat.Type
Ormolu.Printer.Operators
Ormolu.Fixity
Ormolu.Fixity.Imports
Ormolu.Fixity.Internal
Ormolu.Fixity.Parser
Ormolu.Fixity.Printer
Ormolu.Printer.SpanStream
Ormolu.Processing.Common
Ormolu.Processing.Cpp
Ormolu.Processing.Preprocess
Ormolu.Terminal
Ormolu.Terminal.QualifiedDo
Ormolu.Utils
Ormolu.Utils.Cabal
Ormolu.Utils.Fixity
Ormolu.Utils.IO

hs-source-dirs: src
other-modules: GHC.DynFlags
default-language: GHC2021
build-depends:
Cabal-syntax >=3.12 && <3.13,
Diff >=0.4 && <1,
MemoTrie >=0.6 && <0.7,
ansi-terminal >=0.10 && <1.2,
array >=0.5 && <0.6,
base >=4.14 && <5,
binary >=0.8 && <0.9,
bytestring >=0.2 && <0.13,
choice >=0.2.4.1 && <0.3,
containers >=0.5 && <0.8,
deepseq >=1.4 && <1.6,
directory ^>=1.3,
file-embed >=0.0.15 && <0.1,
filepath >=1.2 && <1.6,
ghc-lib-parser >=9.10 && <9.11,
megaparsec >=9,
mtl >=2 && <3,
syb >=0.7 && <0.8,
text >=2.1 && <3

if flag(dev)
ghc-options:
-Wall -Werror -Wredundant-constraints -Wpartial-fields
-Wunused-packages

else
ghc-options: -O2 -Wall

if flag(internal-bundle-fixities)
cpp-options: -DBUNDLE_FIXITIES
exposed-modules:
Ormolu
Ormolu.Config
Ormolu.Diff.ParseResult
Ormolu.Diff.Text
Ormolu.Exception
Ormolu.Fixity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're interested, Gild can automatically discover modules for you:
https://github.com/tfausak/cabal-gild/blob/7cc71c53dc1a086220c7b15a1d5a9c9e312b357f/README.md#discover

library
  -- cabal-gild: discover src --exclude=src/GHC/DynFlags.hs
  exposed-modules: ...

Ormolu.Fixity.Imports
Ormolu.Fixity.Internal
Ormolu.Fixity.Parser
Ormolu.Fixity.Printer
Ormolu.Imports
Ormolu.Parser
Ormolu.Parser.CommentStream
Ormolu.Parser.Pragma
Ormolu.Parser.Result
Ormolu.Printer
Ormolu.Printer.Combinators
Ormolu.Printer.Comments
Ormolu.Printer.Internal
Ormolu.Printer.Meat.Common
Ormolu.Printer.Meat.Declaration
Ormolu.Printer.Meat.Declaration.Annotation
Ormolu.Printer.Meat.Declaration.Class
Ormolu.Printer.Meat.Declaration.Data
Ormolu.Printer.Meat.Declaration.Default
Ormolu.Printer.Meat.Declaration.Foreign
Ormolu.Printer.Meat.Declaration.Instance
Ormolu.Printer.Meat.Declaration.OpTree
Ormolu.Printer.Meat.Declaration.RoleAnnotation
Ormolu.Printer.Meat.Declaration.Rule
Ormolu.Printer.Meat.Declaration.Signature
Ormolu.Printer.Meat.Declaration.Splice
Ormolu.Printer.Meat.Declaration.Type
Ormolu.Printer.Meat.Declaration.TypeFamily
Ormolu.Printer.Meat.Declaration.Value
Ormolu.Printer.Meat.Declaration.Warning
Ormolu.Printer.Meat.ImportExport
Ormolu.Printer.Meat.Module
Ormolu.Printer.Meat.Pragma
Ormolu.Printer.Meat.Type
Ormolu.Printer.Operators
Ormolu.Printer.SpanStream
Ormolu.Processing.Common
Ormolu.Processing.Cpp
Ormolu.Processing.Preprocess
Ormolu.Terminal
Ormolu.Terminal.QualifiedDo
Ormolu.Utils
Ormolu.Utils.Cabal
Ormolu.Utils.Fixity
Ormolu.Utils.IO

hs-source-dirs: src
other-modules: GHC.DynFlags
default-language: GHC2021
build-depends:
Cabal-syntax >=3.12 && <3.13,
Diff >=0.4 && <1,
MemoTrie >=0.6 && <0.7,
ansi-terminal >=0.10 && <1.2,
array >=0.5 && <0.6,
base >=4.14 && <5,
binary >=0.8 && <0.9,
bytestring >=0.2 && <0.13,
choice >=0.2.4.1 && <0.3,
containers >=0.5 && <0.8,
deepseq >=1.4 && <1.6,
directory ^>=1.3,
file-embed >=0.0.15 && <0.1,
filepath >=1.2 && <1.6,
ghc-lib-parser >=9.10 && <9.11,
megaparsec >=9,
mtl >=2 && <3,
syb >=0.7 && <0.8,
text >=2.1 && <3,

if flag(dev)
ghc-options:
-Wall
-Werror
-Wredundant-constraints
-Wpartial-fields
-Wunused-packages
else
ghc-options:
-O2
-Wall

if flag(internal-bundle-fixities)
cpp-options: -DBUNDLE_FIXITIES

executable ormolu
main-is: Main.hs
hs-source-dirs: app
other-modules: Paths_ormolu
autogen-modules: Paths_ormolu
default-language: GHC2021
build-depends:
Cabal-syntax >=3.12 && <3.13,
base >=4.12 && <5,
containers >=0.5 && <0.8,
directory ^>=1.3,
filepath >=1.2 && <1.6,
ghc-lib-parser >=9.10 && <9.11,
optparse-applicative >=0.14 && <0.19,
ormolu,
text >=2.1 && <3,
th-env >=0.1.1 && <0.2

if flag(dev)
ghc-options:
-Wall -Werror -Wredundant-constraints -Wpartial-fields
-Wunused-packages -Wwarn=unused-packages

else
ghc-options: -O2 -Wall -rtsopts
main-is: Main.hs
hs-source-dirs: app
other-modules: Paths_ormolu
autogen-modules: Paths_ormolu
default-language: GHC2021
build-depends:
Cabal-syntax >=3.12 && <3.13,
base >=4.12 && <5,
containers >=0.5 && <0.8,
directory ^>=1.3,
filepath >=1.2 && <1.6,
ghc-lib-parser >=9.10 && <9.11,
optparse-applicative >=0.14 && <0.19,
ormolu,
text >=2.1 && <3,
th-env >=0.1.1 && <0.2,

if flag(dev)
ghc-options:
-Wall
-Werror
-Wredundant-constraints
-Wpartial-fields
-Wunused-packages
-Wwarn=unused-packages
else
ghc-options:
-O2
-Wall
-rtsopts

test-suite tests
type: exitcode-stdio-1.0
main-is: Spec.hs
build-tool-depends: hspec-discover:hspec-discover >=2 && <3
hs-source-dirs: tests
other-modules:
Ormolu.CabalInfoSpec
Ormolu.Diff.TextSpec
Ormolu.Fixity.ParserSpec
Ormolu.Fixity.PrinterSpec
Ormolu.FixitySpec
Ormolu.OpTreeSpec
Ormolu.Parser.OptionsSpec
Ormolu.Parser.ParseFailureSpec
Ormolu.Parser.PragmaSpec
Ormolu.PrinterSpec

default-language: GHC2021
build-depends:
Cabal-syntax >=3.12 && <3.13,
QuickCheck >=2.14,
base >=4.14 && <5,
choice >=0.2.4.1 && <0.3,
containers >=0.5 && <0.8,
directory ^>=1.3,
filepath >=1.2 && <1.6,
ghc-lib-parser >=9.10 && <9.11,
hspec >=2 && <3,
hspec-megaparsec >=2.2,
megaparsec >=9,
ormolu,
path >=0.6 && <0.10,
path-io >=1.4.2 && <2,
temporary ^>=1.3,
text >=2.1 && <3

if flag(dev)
ghc-options:
-Wall -Werror -Wredundant-constraints -Wpartial-fields
-Wunused-packages

else
ghc-options: -O2 -Wall
type: exitcode-stdio-1.0
main-is: Spec.hs
build-tool-depends: hspec-discover:hspec-discover >=2 && <3
hs-source-dirs: tests
other-modules:
Ormolu.CabalInfoSpec
Ormolu.Diff.TextSpec
Ormolu.Fixity.ParserSpec
Ormolu.Fixity.PrinterSpec
Ormolu.FixitySpec
Ormolu.OpTreeSpec
Ormolu.Parser.OptionsSpec
Ormolu.Parser.ParseFailureSpec
Ormolu.Parser.PragmaSpec
Ormolu.PrinterSpec

default-language: GHC2021
build-depends:
Cabal-syntax >=3.12 && <3.13,
QuickCheck >=2.14,
base >=4.14 && <5,
choice >=0.2.4.1 && <0.3,
containers >=0.5 && <0.8,
directory ^>=1.3,
filepath >=1.2 && <1.6,
ghc-lib-parser >=9.10 && <9.11,
hspec >=2 && <3,
hspec-megaparsec >=2.2,
megaparsec >=9,
ormolu,
path >=0.6 && <0.10,
path-io >=1.4.2 && <2,
temporary ^>=1.3,
text >=2.1 && <3,

if flag(dev)
ghc-options:
-Wall
-Werror
-Wredundant-constraints
-Wpartial-fields
-Wunused-packages
else
ghc-options:
-O2
-Wall