#!/bin/sh -e
# fall back to find if there is no git, e.g. in package builds
# shellcheck disable=SC2046
RUFF="${1:-ruff}"
set -- $(git ls-files "*.py" 2> /dev/null || find . -name '*.py')
"$RUFF" check "$@"
"$RUFF" format --check "$@"
