Skip to content

Commit

Permalink
uncrustify: Use replace option for correcting findings
Browse files Browse the repository at this point in the history
currently, we are using --check option to check for uncrustify
failures, it is better to use --replace instead of --check as it
corrects the failures beside doing what --check does. Developers can
benefit from this improvement when they run the pre-commit locally. In
addition, use same command line options for uncrustify for both
internal and public CI.

Uncrustify should check for all the FRI project files
except for those that are downloaded with git submodule,
to do so, we have to de-init all the submodules before
Uncrustify tool run and then initialise them back right
after it finish.

Signed-off-by: Ahmed Ismail <[email protected]>
  • Loading branch information
AhmedIsmail02 authored and urutva committed Nov 20, 2023
1 parent f16b31d commit 1d45b35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tools/scripts/run_uncrustify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
# <[email protected]>
# SPDX-License-Identifier: MIT

find Projects Config -iname "*.[hc]" -exec uncrustify --check -c Tools/uncrustify.cfg {} +
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
1 change: 1 addition & 0 deletions release_changes/202311150923.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uncrustify: Use replace option for correcting findings.

0 comments on commit 1d45b35

Please sign in to comment.