From 1cf532828a7b37a5ab8236c74a06d64082a6475a Mon Sep 17 00:00:00 2001 From: Eric Conlon Date: Mon, 18 Dec 2023 12:41:31 -0800 Subject: [PATCH] update --- justfile | 26 +++++++++++++++++--------- stack.yaml | 2 +- stack.yaml.lock | 8 ++++---- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/justfile b/justfile index e7b38ba..66ddf17 100644 --- a/justfile +++ b/justfile @@ -5,29 +5,33 @@ src_dirs := "src test" default: just --list +# Build and run tests on file change +watch target="": + {{ stack_build }} --test --file-watch {{ target }} + # Build and run tests -test: - {{ stack_build }} --test +test target="": + {{ stack_build }} --test {{ target }} # Build only -build: - {{ stack_build }} --test --no-run-tests +build target="": + {{ stack_build }} --test --no-run-tests {{ target }} + +# Enter repl +repl target="": + stack ghci --test --ghci-options "-XOverloadedStrings" {{ target }} # Clean stack work clean: stack clean --full -# Enter repl -ghci: - stack ghci --test - # Open browser with generated docs docs: stack haddock --open # Install tool deps deps: - stack build --copy-compiler-tool hlint fourmolu + stack build --copy-compiler-tool hlint fourmolu apply-refact # Format with fourmolu format: @@ -37,3 +41,7 @@ format: lint: stack exec -- hlint {{ src_dirs }} +# Apply hlint suggestions +lint-apply: + find {{ src_dirs }} -name '*.hs' | xargs -t -I % stack exec -- hlint % --refactor --refactor-options="--inplace" + diff --git a/stack.yaml b/stack.yaml index f2de650..8523913 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-20.17 +resolver: lts-22.0 ghc-options: "$everything": -haddock diff --git a/stack.yaml.lock b/stack.yaml.lock index ca0f44a..ff66013 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,7 +6,7 @@ packages: [] snapshots: - completed: - sha256: 14ca51a9a597c32dd7804c10d079feea3d0ae40c5fbbb346cbd67b3ae49f6d01 - size: 649598 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/17.yaml - original: lts-20.17 + sha256: e176944bc843f740e05242fa7a66ca1f440c127e425254f7f1257f9b19add23f + size: 712153 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/0.yaml + original: lts-22.0