contrib: fix "nm-python-black-format.sh" script to ignore systemd,c-util,nettools files

Otherwise, the path "src/c-stdaux/src/docs/conf.py" matches for
formatting. But this file is imported via git-subtree, we don't
want to format it.

Filter out such paths.
This commit is contained in:
Thomas Haller 2022-07-06 10:43:54 +02:00
parent 42a70ce1d9
commit 30d89a121d
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -75,6 +75,16 @@ FILES=()
FILES+=( $(git ls-tree --name-only -r HEAD | grep '\.py$') )
FILES+=( $(git grep -l '#!.*\<p[y]thon3\?\>') )
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