diff options
| author | Martin Hořeňovský | 2020-11-06 15:36:26 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-11-06 21:36:31 +0100 |
| commit | 2baa472bcc35427d3bbe759554f224cef4feeef0 (patch) | |
| tree | bd45b577e7e80d1b69de9c1f1356676a19159759 | |
| parent | f97436a1f7cd1b319c45e5444e468b89663d447d (diff) | |
| download | catch3-2baa472bcc35427d3bbe759554f224cef4feeef0.tar.gz | |
Add GitHub action to check that include guards use standard pattern
Based on work by @innerout, but finished and merged by me, because
the GitHub action refused to run for him.
Closes #2075
Closes #2091
| -rw-r--r-- | .github/workflows/validate-header-guards.yml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/.github/workflows/validate-header-guards.yml b/.github/workflows/validate-header-guards.yml new file mode 100644 index 00000000..c57bd8f3 --- /dev/null +++ b/.github/workflows/validate-header-guards.yml @@ -0,0 +1,33 @@ +name: Check header guards + +# Run this workflow every time a new commit pushed to your repository + +on: [push, pull_request] + +jobs: + # Set the job key. The key is displayed as the job name + # when a job name is not provided + checkguard: + # Name the Job + name: Check include guard naming convention + # Set the type of machine to run on + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Dependencies + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install checkguard + run: pip install guardonce + + - name: Run checkguard + run: | + wrong_files=$(checkguard -r src/catch2/ -p "name | append _INCLUDED | upper") + if [[ $wrong_files ]]; then + echo "Files with wrong header guard:" + echo $wrong_files + exit 1 + fi |