gh-actions: add formatting check for preprocessor indentation
Currently only applies to avx*.h, but I intend to expand this check as
more files are brought in line.
@@ -13,6 +13,8 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 2
+ - name: Install pcre2grep
+ run: sudo apt-get install -y pcre2-utils
# Check for trailing whitespace
- name: Trailing whitespace
run: find simde/ -name '*.c' -o -name '*.h' -exec grep -nP '\s+$' {} + && exit 1 || exit 0
@@ -47,6 +49,9 @@ jobs:
# Make sure we don't accidentally use `vector ...` instead of SIMDE_POWER_ALTIVEC_VECTOR(...)
- name: AltiVec raw vector keyword
run: find simde/ -name '*.c' -o -name '*.h' -exec grep -nP 'vector( +)((bool|signed|unsigned) +)?(double|float|long long|long|int|short|char)' {} + && exit 1 || exit 0
+ # Check indentation of preprocessor directives.
+ - name: Preprocessor directive indentation
+ run: find simde/x86 -name 'avx*.h' -exec pcre2grep -M '{\n#' {} + && exit 1 || exit 0
x86:
runs-on: ubuntu-latest
