mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
citemplate: add support for .indentignore file to indent job
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1465 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-ci/-/merge_requests/328>
This commit is contained in:
parent
91c85b7ca9
commit
1ab716b71d
1 changed files with 14 additions and 1 deletions
|
@ -358,7 +358,20 @@ gst indent:
|
|||
script:
|
||||
# man indent. grep RETURN VALUE, grab a beer on my behalf...
|
||||
- indent --version || true
|
||||
- find . -name '*.c' -exec gst-indent {} +
|
||||
- |
|
||||
filter_cmd="cat"
|
||||
if test -f ".indentignore"; then
|
||||
filter_args=""
|
||||
while read -r line; do
|
||||
if test -n "$line"; then
|
||||
filter_args="$filter_args -e $line"
|
||||
fi
|
||||
done < ".indentignore"
|
||||
if test -n "$filter_args"; then
|
||||
filter_cmd="grep -v $filter_args"
|
||||
fi
|
||||
fi
|
||||
find . -name '*.c' | $filter_cmd | xargs gst-indent
|
||||
- |
|
||||
if git diff --quiet; then
|
||||
echo "Code is properly formatted"
|
||||
|
|
Loading…
Reference in a new issue