diff --git a/scripts/fmt.sh b/scripts/fmt.sh index 8a8cda6..882eb3d 100755 --- a/scripts/fmt.sh +++ b/scripts/fmt.sh @@ -9,6 +9,15 @@ set -eux pipefail scripts_home="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" project_home="$(dirname "${scripts_home}")" cd "${project_home}" +# shellcheck source=/dev/null +. "${scripts_home}/shared.sh" -isort ./*.py example/*.py example/**/*.py -black --config pyproject.toml example/ ./*.py \ No newline at end of file +# unless we manually provide an override, use whatever's +# on the path by default. +if ! is-set PYTHON; then + isort ./*.py example/*.py example/**/*.py + black --config pyproject.toml example/ ./*.py +else + ${PYTHON} -m isort ./*.py example/*.py example/**/*.py + ${PYTHON} -m black --config pyproject.toml example/ ./*.py +fi diff --git a/scripts/lint.sh b/scripts/lint.sh index 2793f1a..892d686 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -8,10 +8,18 @@ set -eux pipefail scripts_home="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" project_home="$(dirname "${scripts_home}")" cd "${project_home}" +# shellcheck source=/dev/null +. "${scripts_home}/shared.sh" # run our python lint checks -pylint ./*.py example/*.py example/**/*.py -pyright example/breeze_theme.py -flake8 - -# run our C++ lint checks \ No newline at end of file +# unless we manually provide an override, use whatever's +# on the path by default. +if ! is-set PYTHON; then + pylint ./*.py example/*.py example/**/*.py + pyright example/breeze_theme.py + flake8 +else + ${PYTHON} -m pylint ./*.py example/*.py example/**/*.py + ${PYTHON} -m pyright example/breeze_theme.py + ${PYTHON} -m flake8 +fi