You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: Clang-Format Checkon:
pull_request:
branches:
- main
- masterpush:
branches:
- main
- masterjobs:
clang-format:
runs-on: ubuntu-lateststeps:
- name: Checkout repositoryuses: actions/checkout@v2
- name: Set up clang-formatrun: sudo apt-get install -y clang-format
- name: Run clang-formatrun: | # Find all C++ source files and check if they comply with the format FILES=$(find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.c') for file in $FILES; do clang-format --style=file $file | diff -u $file - done
- name: Fail if format is incorrectrun: | FILES=$(find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.c') for file in $FILES; do if ! clang-format --style=file $file | diff -u $file -; then echo "Formatting error in $file" exit 1 fi done
The text was updated successfully, but these errors were encountered:
clang-format -style='{IndentWidth: 4, ColumnLimit: 80}' -i A.cpp
file:
.clang-format
.github/workflows/clang-format.yml
The text was updated successfully, but these errors were encountered: