Skip to content

Commit

Permalink
ci(#348): add fourmolu auto-commit to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhxyz committed Sep 5, 2024
1 parent 079f3aa commit 10ee63f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install fourmolu
run: cabal install fourmolu --overwrite-policy=always

- name: Lint Haskell
run: |
find . -name '*.hs' -exec sh -c 'for file do fourmolu -i "$file"; done' sh {} +
- name: Auto-commit lint
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: fourmolu auto-commit
commit_user_name: GitHub Action
commit_user_email: [email protected]
branch: ${{ github.head_ref }}

- name: Install LIBSODIUM
run: |
git clone https://github.com/input-output-hk/libsodium
Expand Down
48 changes: 44 additions & 4 deletions fourmolu.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
# Number of spaces per indentation step
indentation: 2
comma-style: leading

# Max line length for automatic line breaking
column-limit: none

# Styling of arrows in type signatures (choices: trailing, leading, or leading-args)
function-arrows: leading

# How to place commas in multi-line lists, records, etc. (choices: leading or trailing)
comma-style: trailing

# Styling of import/export lists (choices: leading, trailing, or diff-friendly)
import-export-style: diff-friendly

# Whether to full-indent or half-indent 'where' bindings past the preceding body
indent-wheres: false

# Whether to leave a space before an opening record brace
record-brace-space: true
indent-wheres: true
respectful: true
haddock-style: multi-line

# Number of spaces between top-level declarations
newlines-between-decls: 1

# How to print Haddock comments (choices: single-line, multi-line, or multi-line-compact)
haddock-style: multi-line

# How to print module docstring
haddock-style-module: null

# Styling of let blocks (choices: auto, inline, newline, or mixed)
let-style: auto

# How to align the 'in' keyword with respect to the 'let' keyword (choices: left-align, right-align, or no-space)
in-style: right-align

# Whether to put parentheses around a single constraint (choices: auto, always, or never)
single-constraint-parens: never

# Output Unicode syntax (choices: detect, always, or never)
unicode: always

# Give the programmer more choice on where to insert blank lines
respectful: false

# Fixity information for operators
fixities: []

0 comments on commit 10ee63f

Please sign in to comment.