Skip to content

Commit

Permalink
Move to clang-format 17 docker based checks (#179)
Browse files Browse the repository at this point in the history
* Move to clang-format 17 docker based checks
  • Loading branch information
baconpaul authored Oct 21, 2023
1 parent 3074ce0 commit fc1707d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 32 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
19 changes: 0 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
# )
# }}}

0 comments on commit fc1707d

Please sign in to comment.