Add comments #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clang-format workflow | |
# Github: https://www.github.com/0x4248/workflows | |
# By: 0x4248 | |
name: Clang-format | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
python-black: | |
name: Format code using clang-format | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: sudo apt-get install clang-format | |
- name: Git pull | |
run: | | |
git pull | |
- name: Format C code | |
run: | | |
find . -type f -name "*.c" -exec clang-format {} -i -style="{IndentWidth: 4}" \; | |
- name: Format C++ code | |
run: | | |
find . -type f -name "*.cpp" -exec clang-format {} -i -style="{IndentWidth: 4}" \; | |
- name: Format C header code | |
run: | | |
find . -type f -name "*.h" -exec clang-format {} -i -style="{IndentWidth: 4}" \; | |
- name: Format C++ header code | |
run: | | |
find . -type f -name "*.hpp" -exec clang-format {} -i -style="{IndentWidth: 4}" \; | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Format C/C++ code with clang-format" |