name: clang-format Check
on:
  pull_request:

permissions:
  contents: read

jobs:
  formatting-check:
    name: Formatting Check
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, 'skip-ci')"
    steps:
    - uses: actions/checkout@v4.1.7

    - name: Run clang-format style check for C and Java code
      uses: DoozyX/clang-format-lint-action@v0.20
      with:
        source: '.'
        extensions: 'c,h,cpp,hpp,java'
        clangFormatVersion: 17
        style: file
        exclude: './config ./mfhdf/ncgen/ncgenyy.c ./mfhdf/ncgen/ncgentab.c ./mfhdf/ncgen/ncgentab.h'
