mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 07:00:05 +01:00
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:
parent
42a70ce1d9
commit
30d89a121d
1 changed files with 10 additions and 0 deletions
|
|
@ -75,6 +75,16 @@ FILES=()
|
||||||
FILES+=( $(git ls-tree --name-only -r HEAD | grep '\.py$') )
|
FILES+=( $(git ls-tree --name-only -r HEAD | grep '\.py$') )
|
||||||
FILES+=( $(git grep -l '#!.*\<p[y]thon3\?\>') )
|
FILES+=( $(git grep -l '#!.*\<p[y]thon3\?\>') )
|
||||||
FILES=( $(printf "%s\n" "${FILES[@]}" | sort -u) )
|
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"
|
IFS="$OLD_IFS"
|
||||||
|
|
||||||
if [ $SHOW_FILENAMES = 1 ]; then
|
if [ $SHOW_FILENAMES = 1 ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue