-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: Improve
uncrustify
filtering algorithm (#21)
Instead of deiniting git submodules, use `git submodule status` to find the list of exclude directories. Signed-off-by: Devaraj Ranganna <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,21 @@ | |
# <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
git submodule deinit --all -f | ||
find . -iname "*.[hc]" -exec uncrustify --replace --no-backup --if-changed -c Tools/uncrustify.cfg -l C {} + | ||
git submodule update --init --recursive | ||
# Ensure the new line is used to split the output of the `git submodule status` | ||
# command into an array | ||
IFS=$'\n' | ||
|
||
submodules_status=($(git submodule status)) | ||
|
||
exclude_pattern="-E " | ||
for submodule_status in "${submodules_status[@]}" | ||
do | ||
# Ensure the space is used to split the submodule status into an array | ||
IFS=" " | ||
submodule_status_parts=($submodule_status) | ||
submodule_path = "${submodule_status_parts[1]}" | ||
exclude_pattern+="${submodule_path} -E " | ||
done | ||
exclude_pattern+="./build" | ||
|
||
fdfind -E $exclude_pattern -e c -e h --exec uncrustify --no-backup --replace --if-changed -c Tools/uncrustify.cfg -l C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tools: Improve `uncrustify` filtering algorithm |