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

Use fourmolu & cabal-gild formatter in CI #115

Merged
merged 5 commits into from
Oct 16, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/run-fourmolu@v10
- uses: tfausak/cabal-gild-setup-action@v2
- run: cabal-gild --input geniusyield-orderbot.cabal --mode check
- run: cabal-gild --input geniusyield-orderbot-framework/geniusyield-orderbot-framework.cabal --mode check
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
Expand Down
9 changes: 9 additions & 0 deletions fourmolu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
indentation: 2
comma-style: leading
record-brace-space: true
indent-wheres: false
respectful: false
haddock-style: multi-line
newlines-between-decls: 1
single-constraint-parens: never
single-deriving-parens: never
177 changes: 97 additions & 80 deletions geniusyield-orderbot-framework/geniusyield-orderbot-framework.cabal
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
cabal-version: 3.4
name: geniusyield-orderbot-framework
synopsis: Smart Order Router framework
version: 0.5.0
build-type: Simple
license: Apache-2.0
copyright: (c) 2023 GYELD GMBH
author: Lars Bruenjes
maintainer: support@geniusyield.co
category: Blockchain, Cardano, Framework
name: geniusyield-orderbot-framework
synopsis: Smart Order Router framework
version: 0.5.0
build-type: Simple
license: Apache-2.0
copyright: (c) 2023 GYELD GMBH
author: Lars Bruenjes
maintainer: support@geniusyield.co
category: Blockchain, Cardano, Framework
extra-doc-files: CHANGELOG.md

-- Common sections

common common-ghc-opts
ghc-options:
-Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind
-Wno-partial-type-signatures -Wincomplete-record-updates
-Wmissing-deriving-strategies -Wno-name-shadowing -Wunused-foralls
-Wno-unticked-promoted-constructors -fprint-explicit-foralls
-Wall
-Wcompat
-Wincomplete-uni-patterns
-Wno-unused-do-bind
-Wno-partial-type-signatures
-Wincomplete-record-updates
-Wmissing-deriving-strategies
-Wno-name-shadowing
-Wunused-foralls
-Wno-unticked-promoted-constructors
-fprint-explicit-foralls
-fprint-explicit-kinds

common common-deps
build-depends:
, aeson
, aeson-pretty
, atlas-cardano
, base
, bytestring
, containers
, mtl
, mwc-random
, random
, random-fu
, serialise
, text
, time
aeson,
aeson-pretty,
atlas-cardano,
base,
bytestring,
containers,
mtl,
mwc-random,
random,
random-fu,
serialise,
text,
time,

common common-lang
default-language: Haskell2010
Expand Down Expand Up @@ -71,8 +77,8 @@ common common-lang
LambdaCase
MonomorphismRestriction
MultiParamTypeClasses
NamedFieldPuns
MultiWayIf
NamedFieldPuns
NoStarIsType
NumericUnderscores
OverloadedStrings
Expand All @@ -96,84 +102,95 @@ common common-lang
ViewPatterns

-- Build targets

library common
import: common-lang
import: common-deps
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-common
library common
import: common-lang
import: common-deps
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-common
build-depends:
, cardano-api
, geniusyield-dex-api
, postgresql-simple
, postgresql-simple-url
cardano-api,
geniusyield-dex-api,
postgresql-simple,
postgresql-simple-url,

exposed-modules:
GeniusYield.OrderBot.Types

ghc-options:
-O2

library datasource
import: common-lang
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-datasource
build-depends: base, atlas-cardano, geniusyield-orderbot-framework:common, geniusyield-dex-api
library datasource
import: common-lang
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-datasource
build-depends:
atlas-cardano,
base,
geniusyield-dex-api,
geniusyield-orderbot-framework:common,

signatures:
GeniusYield.OrderBot.DataSource

library orderbook
import: common-lang
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-orderbook
library orderbook
import: common-lang
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-orderbook
build-depends:
, aeson
, atlas-cardano
, base
, geniusyield-orderbot-framework:common
, geniusyield-orderbot-framework:datasource
, geniusyield-dex-api
aeson,
atlas-cardano,
base,
geniusyield-dex-api,
geniusyield-orderbot-framework:common,
geniusyield-orderbot-framework:datasource,

signatures:
GeniusYield.OrderBot.OrderBook

exposed-modules:
GeniusYield.OrderBot.OrderBook.Extra

library strategies
import: common-lang
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-strategies
library strategies
import: common-lang
import: common-ghc-opts
visibility: public
hs-source-dirs: lib-strategies
build-depends:
, aeson
, atlas-cardano
, base
, envy
, geniusyield-orderbot-framework:common
, geniusyield-orderbot-framework:orderbook
, geniusyield-dex-api
aeson,
atlas-cardano,
base,
envy,
geniusyield-dex-api,
geniusyield-orderbot-framework:common,
geniusyield-orderbot-framework:orderbook,

signatures:
GeniusYield.OrderBot.Strategies

-- Indefinite library exposing the OrderBot orchestration types and functions.
library
import: common-lang
import: common-deps
import: common-ghc-opts
hs-source-dirs: src
import: common-lang
import: common-deps
import: common-ghc-opts
hs-source-dirs: src
build-depends:
, cardano-api
, envy
, geniusyield-orderbot-framework:common
, geniusyield-orderbot-framework:datasource
, geniusyield-orderbot-framework:orderbook
, geniusyield-orderbot-framework:strategies
, geniusyield-dex-api
, vector
cardano-api,
envy,
geniusyield-dex-api,
geniusyield-orderbot-framework:common,
geniusyield-orderbot-framework:datasource,
geniusyield-orderbot-framework:orderbook,
geniusyield-orderbot-framework:strategies,
vector,

exposed-modules:
GeniusYield.OrderBot
GeniusYield.OrderBot.MatchingStrategy
GeniusYield.OrderBot.OrderBotConfig
GeniusYield.OrderBot.Run

ghc-options:
-O2
Loading
Loading