diff --git a/contrib/scripts/nm-python-black-format.sh b/contrib/scripts/nm-python-black-format.sh index 3a6aaa4b58..869c47f7f8 100755 --- a/contrib/scripts/nm-python-black-format.sh +++ b/contrib/scripts/nm-python-black-format.sh @@ -29,13 +29,6 @@ fi OLD_IFS="$IFS" -IFS=$'\n' -FILES=( $(git ls-tree --name-only -r HEAD | grep '\.py$') ) -IFS="$OLD_IFS" -FILES+=( - "examples/python/gi/nm-wg-set" -) - usage() { printf "Usage: %s [OPTION]...\n" "$(basename "$0")" printf "Reformat python source files using python black.\n\n" @@ -77,6 +70,13 @@ while (( $# )); do esac done +IFS=$'\n' +FILES=() +FILES+=( $(git ls-tree --name-only -r HEAD | grep '\.py$') ) +FILES+=( $(git grep -l '#!.*\
') ) +FILES=( $(printf "%s\n" "${FILES[@]}" | sort -u) ) +IFS="$OLD_IFS" + if [ $SHOW_FILENAMES = 1 ]; then printf '%s\n' "${FILES[@]}" exit 0