Skip to content

Commit

Permalink
Use cabal-gild, add to CI and standards
Browse files Browse the repository at this point in the history
  • Loading branch information
kozross committed Jan 21, 2025
1 parent c765078 commit 2037a7e
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 41 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/covenant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,41 @@ jobs:
with:
path: src/
fail-on: warning
cabal-gild:
name: "Check Cabal file with cabal-gild"
runs-on: ubuntu-latest
steps:
- name: Set up environment
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Set up Haskell
id: setup-haskell
uses: haskell-actions/setup@v2
with:
ghc-version: "9.8"
cabal-version: latest
- name: Check out cabal-gild
uses: actions/checkout@v3
with:
repository: 'tfausak/cabal-gild'
ref: 'f30f35eadd68366b6e3087c060df83eef09be4b2'
- name: Freeze
run: cabal freeze
- name: Cache
uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os}}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- name: Install cabal-gild
run: cabal install
- name: Check out base repo
uses: actions/checkout@v3
- name: Run cabal-gild
run: cabal-gild --input=covenant.cabal --mode=check
tests:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: [generate-matrix, ormolu, hlint]
needs: [generate-matrix, ormolu, hlint, cabal-gild]
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
Expand Down
6 changes: 5 additions & 1 deletion STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ to evolve as our needs change.

# Changelog

## 22/01/2025

* Change `cabal-fmt` requirement to `cabal-gild`

## 17/01/2025

* Changed 'signposting' and 'telegraphing' to 'self-indicating' for clarity
Expand Down Expand Up @@ -225,7 +229,7 @@ Every source file must be formatted according to [ormolu][ormolu]. Each source
code line MUST be at most 100 characters wide, and SHOULD be at most 80
characters wide.

The project's Cabal file MUST be formatted with `cabal-fmt`.
The project's Cabal file MUST be formatted with `cabal-gild`.

Exported identifiers MUST be placed above non-exported identifiers in every
source file. Non-exported identifiers MUST be put under the heading "Helpers",
Expand Down
85 changes: 46 additions & 39 deletions covenant.cabal
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
cabal-version: 3.0
name: covenant
version: 1.0.0
synopsis: Someday something will go here.
description: Someday something will go here.
homepage: https://github.com/mlabs-haskell/covenant
license: Apache-2.0
license-file: LICENSE
author: Koz Ross, Farseen, Sean Hunter
maintainer: koz@mlabs.city, farseen@mlabs.city, sean@mlabs.city
bug-reports: https://github.com/mlabs-haskell/covenant/issues
copyright: (C) MLabs 2024
category: Covenant
tested-with: GHC ==9.8.4 || ==9.10.1 || ==9.12.1
build-type: Simple
cabal-version: 3.0
name: covenant
version: 1.0.0
synopsis: Someday something will go here.
description: Someday something will go here.
homepage: https://github.com/mlabs-haskell/covenant
license: Apache-2.0
license-file: LICENSE
author: Koz Ross, Farseen, Sean Hunter
maintainer: koz@mlabs.city, farseen@mlabs.city, sean@mlabs.city
bug-reports: https://github.com/mlabs-haskell/covenant/issues
copyright: (C) MLabs 2024
category: Covenant
tested-with: ghc ==9.8.4 || ==9.10.1 || ==9.12.1
build-type: Simple
extra-source-files:
CHANGELOG.md
README.md

-- Common sections

common lang
ghc-options:
-Wall -Wcompat -Wredundant-bang-patterns
-Wredundant-strictness-flags -Wmissing-deriving-strategies
-Woperator-whitespace -Wambiguous-fields -Wmisplaced-pragmas
-Wmissing-export-lists -Wmissing-import-lists
-Wall
-Wcompat
-Wredundant-bang-patterns
-Wredundant-strictness-flags
-Wmissing-deriving-strategies
-Woperator-whitespace
-Wambiguous-fields
-Wmisplaced-pragmas
-Wmissing-export-lists
-Wmissing-import-lists

default-extensions:
NoFieldSelectors
NoStarIsType
BangPatterns
BinaryLiterals
DataKinds
Expand All @@ -45,6 +48,8 @@ common lang
KindSignatures
LambdaCase
MultiParamTypeClasses
NoFieldSelectors
NoStarIsType
NumericUnderscores
OverloadedLabels
OverloadedStrings
Expand All @@ -57,34 +62,36 @@ common lang
TypeOperators
UndecidableInstances

default-language: Haskell2010
default-language: Haskell2010

common test-lang
import: lang
ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N
import: lang
ghc-options:
-O2
-threaded
-rtsopts
-with-rtsopts=-N

common bench-lang
import: lang
import: lang
ghc-options: -O2

-- Library

library
import: lang
import: lang
exposed-modules: Covenant.Expr
build-depends:
, algebraic-graphs ==0.7
, base >=4.19.0.0 && <4.22.0.0
, bimap
, containers
, mtl
, optics-core
, QuickCheck
, quickcheck-instances
, quickcheck-transformer
QuickCheck,
algebraic-graphs ==0.7,
base >=4.19.0.0 && <4.22.0.0,
bimap,
containers,
mtl,
optics-core,
quickcheck-instances,
quickcheck-transformer,

hs-source-dirs: src
hs-source-dirs: src

-- Tests

-- Benchmarks

0 comments on commit 2037a7e

Please sign in to comment.