summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-07-06 10:43:54 +0200
committerThomas Haller <thaller@redhat.com>2022-07-06 10:44:18 +0200
commit30d89a121d1b3c6bba5e603641167e8097d3aa45 (patch)
tree869c3f51546cee6aab01155baf33e64a124a3b4f
parent42a70ce1d9c705124f31c5e7ebff93be22d39f9b (diff)
downloadNetworkManager-30d89a121d1b3c6bba5e603641167e8097d3aa45.tar.gz
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.
-rwxr-xr-xcontrib/scripts/nm-python-black-format.sh10
1 files changed, 10 insertions, 0 deletions
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 '#!.*\<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