Skip to content

Commit

Permalink
Install lint binaries directly
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Nov 23, 2020
1 parent 2b39670 commit 8912b7d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
24 changes: 18 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,24 @@ jobs:
executor: ubuntu
steps:
- checkout
- install_stack
- with_stack_cache:
install_deps:
- run:
name: Build linters
command: stack build hlint stylish-haskell
- run:
name: Install hlint
command: |
HLINT_ARCHIVE="hlint-${HLINT_VERSION}-x86_64-linux.tar.gz"
curl -sSLO "https://github.com/ndmitchell/hlint/releases/download/v${HLINT_VERSION}/${HLINT_ARCHIVE}"
mkdir -p ~/.local/bin/
tar xzf "${HLINT_ARCHIVE}" -C ~/.local/bin/ --strip-components=1 "hlint-${HLINT_VERSION}/hlint"
environment:
HLINT_VERSION: 3.1.6
- run:
name: Install stylish-haskell
command: |
STYLISH_ARCHIVE="stylish-haskell-v${STYLISH_VERSION}-linux-x86_64.tar.gz"
curl -sSLO "https://github.com/jaspervdj/stylish-haskell/releases/download/v${STYLISH_VERSION}/${STYLISH_ARCHIVE}"
mkdir -p ~/.local/bin/
tar xzf "${STYLISH_ARCHIVE}" -C ~/.local/bin/ --strip-components=1 "stylish-haskell-v${STYLISH_VERSION}-linux-x86_64/stylish-haskell"
environment:
STYLISH_VERSION: 0.12.2.0
- run:
name: Install Python
command: sudo apt-get install -y python
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ repos:
name: hlint
language: system
files: '\.hs$'
entry: stack exec -- hlint
entry: scripts/exec.sh hlint
- id: stylish-haskell
name: stylish-haskell
language: system
files: '\.hs$'
entry: stack exec -- stylish-haskell -i
entry: scripts/exec.sh stylish-haskell -i
9 changes: 9 additions & 0 deletions scripts/exec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -eux -o pipefail

if type stack &> /dev/null; then
export PATH="$(stack exec -- bash -c 'echo $PATH'):${PATH}"
fi

exec "$@"

0 comments on commit 8912b7d

Please sign in to comment.