mirror of
https://github.com/polybar/polybar.git
synced 2025-06-02 18:22:03 -04:00
fix(cmake): Tidy and format commands
This commit is contained in:
parent
19868041e1
commit
0128014d44
4 changed files with 76 additions and 20 deletions
23
common/clang-tidy.sh
Executable file
23
common/clang-tidy.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
main() {
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "$0 [build_path] [-fix] DIR..." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
args="-p $1"; shift
|
||||
|
||||
if [ "$1" = "-fix" ]; then
|
||||
args="${args} -fix"; shift
|
||||
fi
|
||||
|
||||
# shellcheck disable=2086
|
||||
find "${@:-.}" -regex ".*.[c|h]pp" \
|
||||
-exec printf "\033[32;1m** \033[0mProcessing %s\n" {} \; \
|
||||
-exec clang-tidy $args {} \; \
|
||||
-exec printf "\033[32;1m** \033[0mFormatting %s\n" {} \; \
|
||||
-exec clang-format -style=file -i {} \;
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
Add table
Add a link
Reference in a new issue