# Sam note: this action is from: https://github.com/jidicula/clang-format-action

name: clang-format

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  formatting-check:
    name: Formatting Check
    runs-on: ubuntu-latest
    strategy:
      matrix:
        path:
          - check: 'include'
          - check: 'src'
          - check: 'utilities'
            exclude: '(old_files|qccpack)'  # Exclude file paths containing "old_files" or "qcc_pack"
    steps:
    - uses: actions/checkout@v2
    - name: Run clang-format style check for C/C++ programs.
      uses: jidicula/clang-format-action@v4.13.0
      with:
        clang-format-version: '18'
        check-path: ${{ matrix.path['check'] }}
        exclude-regex: ${{ matrix.path['exclude'] }}
        fallback-style: 'Chromium' # optional
