diff --git a/bin/pyfmt b/bin/pyfmt index a3bc92d7260a3..7dfb2b1f18825 100755 --- a/bin/pyfmt +++ b/bin/pyfmt @@ -19,13 +19,13 @@ cd "$(dirname "$0")/.." try bin/pyactivate -m black . "$@" -args=("--fix") +arg="--fix" while [[ $# -gt 0 ]]; do case $1 in --check) # ruff only supports --fix, not --check - args=() + arg="" shift ;; *) @@ -35,6 +35,9 @@ while [[ $# -gt 0 ]]; do esac done -try bin/pyactivate -m ruff "${args[@]}" --extend-exclude=misc/dbt-materialize . -try bin/pyactivate -m ruff --target-version=py38 "${args[@]}" misc/dbt-materialize +# We want empty arg to not do anything +# shellcheck disable=SC2086 +try bin/pyactivate -m ruff $arg --extend-exclude=misc/dbt-materialize . +# shellcheck disable=SC2086 +try bin/pyactivate -m ruff --target-version=py38 $arg misc/dbt-materialize try_status_report