From fc1707dbe986011b49e7b51c684023d895d4ca77 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 21 Oct 2023 15:05:16 -0400 Subject: [PATCH] Move to clang-format 17 docker based checks (#179) * Move to clang-format 17 docker based checks --- .github/workflows/code-checks.yml | 23 ++++++++++------------- CMakeLists.txt | 19 ------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index e16f9897..9529eb56 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -1,21 +1,18 @@ name: Clap Wrapper Format and Code Checks on: [pull_request] - -defaults: - run: - shell: bash - jobs: - build-code-checks: - name: code-checks + formatting-check: + name: Clang Format Check runs-on: ubuntu-latest strategy: - fail-fast: true + matrix: + path: + - 'src' + - 'include' steps: - uses: actions/checkout@v3 + - name: Run clang-format style check + uses: jidicula/clang-format-action@v4.11.0 with: - submodules: recursive - - name: Run Code Checks - run: | - cmake -Bbuild -DCLAP_WRAPPER_CODE_CHECKS_ONLY=TRUE - cmake --build build --target clap-wrapper-code-checks + clang-format-version: '17' + check-path: ${{ matrix.path }} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fe6fe34..9bcd70b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,22 +130,3 @@ else() endif() - -add_custom_target(clap-wrapper-code-checks) - -# Clang Format checks -find_program(CLANG_FORMAT_EXE NAMES clang-format) -set(CLANG_FORMAT_DIRS src) -set(CLANG_FORMAT_EXTS cpp h) -foreach(dir ${CLANG_FORMAT_DIRS}) - foreach(ext ${CLANG_FORMAT_EXTS}) - list(APPEND CLANG_FORMAT_GLOBS "':(glob)${dir}/**/*.${ext}'") - endforeach() -endforeach() -#add_custom_command(TARGET clap-wrapper-code-checks -# POST_BUILD -# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} -# COMMAND ${CMAKE_COMMAND} -E echo About to check clang-format using ${CLANG_FORMAT_EXE} -# COMMAND git ls-files -- ${CLANG_FORMAT_GLOBS} | xargs ${CLANG_FORMAT_EXE} --dry-run --Werror -# ) -# }}}