diff --git a/.github/workflows/packcheck.yml b/.github/workflows/packcheck.yml index 7361602..9f8561f 100644 --- a/.github/workflows/packcheck.yml +++ b/.github/workflows/packcheck.yml @@ -126,20 +126,12 @@ jobs: command: hlint runner: ubuntu-latest pack_options: >- + HLINTVER=3.6.1 HLINT_OPTIONS="lint" HLINT_TARGETS="src" steps: - uses: actions/checkout@v2 - - #- uses: haskell/actions/setup@v1 - # if: ${{ matrix.name != 'hlint' }} - # with: - # ghc-version: ${{ matrix.ghc_version }} - # enable-stack: true - # stack-version: 'latest' - # cabal-version: 'latest' - - uses: actions/cache@v2 name: Cache common directories with: diff --git a/packcheck.sh b/packcheck.sh index 5799238..0f88a81 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -21,7 +21,6 @@ #------------------------------------------------------------------------------ PACKCHECK_VERSION=0.7.0 -HLINT_VERSION=3.5 show_version() { echo "packcheck version $PACKCHECK_VERSION" @@ -221,11 +220,10 @@ SAFE_ENVVARS="\ CABAL_BUILD_TARGETS \ COVERAGE \ COVERALLS_OPTIONS \ + HLINTVER \ HLINT_BUILD \ HLINT_COMMANDS \ HLINT_OPTIONS \ - HLINT_VERSION \ - HLINT_USE_LOCAL \ HLINT_TARGETS \ CHECK_ENV \ LANG \ @@ -404,8 +402,8 @@ show_help() { show_step1 "hlint options" #help_envvar HLINT_COMMANDS "hlint commands e.g.'hlint lint src; hlint lint test'" - help_envvar HLINT_VERSION "The version of hlint (defaults to $HLINT_VERSION)" - help_envvar HLINT_USE_LOCAL "Use the local hlint found on \$PATH" + help_envvar HLINTVER "Download a specific version binary of hlint instead of using one in PATH" + help_envvar HLINT_BUILD "Build latest hlint from hackage source" help_envvar HLINT_OPTIONS "hlint arguments e.g.'--datadir=. lint'" help_envvar HLINT_TARGETS "target directories to run hlint on e.g. 'src test'" @@ -445,7 +443,6 @@ check_all_boolean_vars () { check_boolean_var DISABLE_DOCS check_boolean_var COVERAGE check_boolean_var CHECK_ENV - check_boolean_var HLINT_USE_LOCAL } show_build_command() { @@ -1629,9 +1626,9 @@ install_hlint() { fi local PACKAGE=hlint - VERSION=$HLINT_VERSION + VERSION=$HLINTVER - echo "Installing hlint version $HLINT_VERSION" + echo "Installing hlint version $HLINTVER" URL="https://github.com/ndmitchell/$PACKAGE/releases/download/v$VERSION/hlint-$VERSION-x86_64-$OS$EXT" TEMP=$(mktemp -d .$PACKAGE-XXXXXX) @@ -1956,24 +1953,17 @@ test -n "$STACK_YAML" || unset STACK_YAML CABAL_BINARY_NAME=cabal if test "$BUILD" = "hlint" then - - if test -z "$HLINT_USE_LOCAL" + if test -n "$HLINT_BUILD" then - if test -n "$HLINT_BUILD" - then - build_hlint - else - install_hlint - fi + build_hlint + elif test -n "$HLINTVER" + then + install_hlint fi run_hlint - else - verify_build_config - build_compile - fi show_step "Done"