| | #!/bin/bash -ex |
| |
|
| | |
| | |
| |
|
| | shopt -s nullglob globstar |
| |
|
| | if git grep -nrI '\s$' src **/*.yml **/*.txt **/*.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop dist/*.svg dist/*.xml; then |
| | echo Trailing whitespace found, aborting |
| | exit 1 |
| | fi |
| |
|
| | |
| | CLANG_FORMAT="${CLANG_FORMAT:-clang-format-15}" |
| | "$CLANG_FORMAT" --version |
| |
|
| | |
| | set +x |
| |
|
| | |
| | FILES_TO_LINT="$(find src/ -name '*.cpp' -or -name '*.h')" |
| |
|
| | for f in $FILES_TO_LINT; do |
| | echo "$f" |
| | "$CLANG_FORMAT" -i "$f" |
| | done |
| |
|
| | DIFF=$(git -c core.fileMode=false diff) |
| |
|
| | if [ ! -z "$DIFF" ]; then |
| | echo "!!! Not compliant to coding style, here is the fix:" |
| | echo "$DIFF" |
| | exit 1 |
| | fi |
| |
|
| | cd src/android |
| | ./gradlew ktlintCheck |
| |
|