Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Stack 2.1.1 #32

Merged
merged 1 commit into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ 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" }}
v2-{{ checksum "cache-key.txt" }}
- &install-stack-deps
run:
name: Build external dependencies
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