Skip to content

Commit

Permalink
Simplify hlint options
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Dec 15, 2023
1 parent 2d642c6 commit 652e263
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/packcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 10 additions & 20 deletions packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#------------------------------------------------------------------------------

PACKCHECK_VERSION=0.7.0
HLINT_VERSION=3.5

show_version() {
echo "packcheck version $PACKCHECK_VERSION"
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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'"

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"

0 comments on commit 652e263

Please sign in to comment.