diff --git a/contrib/scripts/nm-python-black-format.sh b/contrib/scripts/nm-python-black-format.sh index 869c47f7f8..eae84fdb8e 100755 --- a/contrib/scripts/nm-python-black-format.sh +++ b/contrib/scripts/nm-python-black-format.sh @@ -75,6 +75,16 @@ FILES=() FILES+=( $(git ls-tree --name-only -r HEAD | grep '\.py$') ) FILES+=( $(git grep -l '#!.*\') ) FILES=( $(printf "%s\n" "${FILES[@]}" | sort -u) ) + +# Filter out paths that are forked from upstream projects and not +# ours to reformat. +FILES=( $( + printf "%s\n" "${FILES[@]}" | + sed \ + -e '/^src\/[cn]-[^/]\+\//d' \ + -e '/^src\/libnm-systemd-[^/]\+\/src\//d' +) ) + IFS="$OLD_IFS" if [ $SHOW_FILENAMES = 1 ]; then