Skip to content

Commit

Permalink
Merge pull request #229 from koterpillar/fix-lint
Browse files Browse the repository at this point in the history
chore: fix lint script on macOS bash
  • Loading branch information
koterpillar authored Aug 12, 2024
2 parents def5f63 + f526206 commit 96f8877
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

set -euo pipefail

ISORT_ARGS=(--check)
BLACK_ARGS=(--check)
if [ "${1-}" == "--format" ]
# macOS's bash (3.x) can't interpolate empty arrays into parameters under
# nounset; keep command and args together as a workaround.
ISORT=(isort)
BLACK=(black)
if [ "${1-}" != "--format" ]
then
ISORT_ARGS=()
BLACK_ARGS=()
ISORT+=(--check)
BLACK+=(--check)
fi

DIR=$(cd "$(dirname "$0")" && pwd)
Expand All @@ -17,8 +19,8 @@ shellcheck $(grep -lER '^#!.+bash' "$DIR")

PYTHON=("${DIR}/mybox" "${DIR}/tests")

poetry run isort "${ISORT_ARGS[@]}" "${PYTHON[@]}"
poetry run black "${BLACK_ARGS[@]}" "${PYTHON[@]}"
poetry run "${ISORT[@]}" "${PYTHON[@]}"
poetry run "${BLACK[@]}" "${PYTHON[@]}"
poetry run mypy "${PYTHON[@]}"
poetry run pylint "${PYTHON[@]}"
poetry run fawltydeps

0 comments on commit 96f8877

Please sign in to comment.