Skip to content

Commit

Permalink
Merge pull request #47 from osvita-io/oleks-format-with-ormolu
Browse files Browse the repository at this point in the history
Use Ormolu to format Haskell files
  • Loading branch information
oleks authored Jul 20, 2024
2 parents 2ce277f + c668e2c commit 43c7e8a
Show file tree
Hide file tree
Showing 27 changed files with 941 additions and 665 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
on: [push]
name: build
jobs:
runhaskell:
ormolu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/run-ormolu@v16 # NB!
# If you update the version of run-ormolu, please also update the
# version in .docker/Dockerfile, so that the docker image will use the
# same version of ormolu.
#
# See also
# https://github.com/haskell-actions/run-ormolu/releases
# https://github.com/tweag/ormolu/releases/

test:
name: stack test
runs-on: ubuntu-latest
needs: ormolu
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
Expand All @@ -17,4 +31,3 @@ jobs:
dist-newstyle
.stack-work
key: ${{ runner.os }}
- run: stack test
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build interact
.PHONY: build interact check_format

name:=$(shell basename $(CURDIR))
version:=9.4-slim_0
Expand All @@ -10,11 +10,17 @@ build: docker/Dockerfile Makefile
docker

interact: build docker/Dockerfile Makefile
mkdir -p .home
docker run \
--interactive --tty --rm \
--volume "$(shell pwd):/src" \
--volume "$(shell pwd)/.home:/home/alis" \
--workdir "/src" \
--volume "$(shell pwd):/remarks" \
--workdir "/remarks" \
--entrypoint bash \
$(tag)

check_format: build Makefile
docker run \
--rm \
--volume "$(shell pwd):/remarks" \
--workdir "/remarks" \
$(tag) \
ormolu --mode check $(shell find . -type f -name '*.hs')
1 change: 1 addition & 0 deletions Setup.hs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Distribution.Simple

main = defaultMain
Loading

0 comments on commit 43c7e8a

Please sign in to comment.