Skip to content

Commit

Permalink
Fix for Stack 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-leapyear committed Jun 16, 2019
1 parent bf455bf commit ee3473d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ aliases:
package.yaml
)
cat "${FILES[@]}" > cache-key.txt
curl -sSL https://get.haskellstack.org/ | sed -n 's/^STACK_VERSION="\(.*\)"/\1/p' >> cache-key.txt
- &cache-key
v1-{{ checksum "cache-key.txt" }}
- &install-stack-deps
Expand Down Expand Up @@ -104,6 +105,7 @@ jobs:
key: *cache-key
paths:
- ~/.stack
- ~/.local
- *run-build
- persist_to_workspace:
root: .
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.stack-work
.DS_Store
*.cabal
stack.yaml.lock
2 changes: 1 addition & 1 deletion scripts/hlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -eo pipefail

builtin cd "$(dirname "${BASH_SOURCE[0]}")/.."

stack exec -- hlint .
stack exec -- ~/.local/bin/hlint .
2 changes: 1 addition & 1 deletion scripts/install-stack-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
set -eo pipefail

stack build --test --only-dependencies
stack build hlint stylish-haskell
stack install hlint stylish-haskell
8 changes: 7 additions & 1 deletion scripts/stylish-haskell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ function check_file_empty() {
fi
}

RUN_STYLISH=~/.local/bin/stylish-haskell
if [[ ! -f "${RUN_STYLISH}" ]]; then
echo "stylish-haskell not found"
exit 1
fi

if [[ "$STYLISH_APPLY" == 1 ]]; then
get_files | xargs stack exec -- stylish-haskell --inplace
else
trap 'rm -rf .tmp' 0
get_files | while read FILE; do
mkdir -p ".tmp/$(dirname "$FILE")"
stack exec -- stylish-haskell "$FILE" | diff_no_fail --unified "$FILE" - > .tmp/"$FILE"
stack exec -- "${RUN_STYLISH}" "$FILE" | diff_no_fail --unified "$FILE" - > .tmp/"$FILE"
done
find .tmp -type f | xargs cat | tee .tmp/diffs.txt
check_file_empty .tmp/diffs.txt
Expand Down

0 comments on commit ee3473d

Please sign in to comment.