mirror of
https://github.com/polybar/polybar.git
synced 2024-10-27 05:23:39 -04:00
72948dbc97
Before, because of [ -d "$search" ] || search="$(dirname "$search")", clang-format.sh would search for files to format in the whole repo (even in the build directory and the submodules) This now also looks for source files in the tests folder I have removed the clang-format from clang-tidy.sh because one may want to run clang-tidy without reformatting
26 lines
468 B
Bash
Executable file
26 lines
468 B
Bash
Executable file
#!/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
|
|
|
|
# Search paths
|
|
search="${*:-.}"
|
|
|
|
echo "$0 in $search"
|
|
|
|
# shellcheck disable=2086
|
|
find $search -iname "*.cpp" \
|
|
-exec printf "\\033[32;1m** \\033[0mProcessing %s\\n" {} \; \
|
|
-exec clang-tidy $args {} \;
|
|
}
|
|
|
|
main "$@"
|