style: Apply custom cmake definitions (#2983)

This commit is contained in:
Ayaz Salikhov
2026-03-06 14:28:13 +00:00
committed by GitHub
parent 43e8c8cddb
commit 3737459d09
4 changed files with 30 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
# Custom CMake command definitions for gersemi formatting.
# These stubs teach gersemi the signatures of project-specific commands
# so it can format their invocations correctly.
function(setup_target_for_coverage_gcovr)
set(options NONE)
set(oneValueArgs BASE_DIRECTORY NAME FORMAT)
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
cmake_parse_arguments(
THIS_FUNCTION_PREFIX
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
endfunction()
function(append_coverage_compiler_flags_to_target name mode)
endfunction()

1
.gersemirc Normal file
View File

@@ -0,0 +1 @@
definitions: [.gersemi]

View File

@@ -8,7 +8,7 @@ on:
jobs:
run-hooks:
uses: XRPLF/actions/.github/workflows/pre-commit.yml@320be44621ca2a080f05aeb15817c44b84518108
uses: XRPLF/actions/.github/workflows/pre-commit.yml@56de1bdf19639e009639a50b8d17c28ca954f267
with:
runs_on: heavy
container: '{ "image": "ghcr.io/xrplf/clio-pre-commit:14342e087ceb8b593027198bf9ef06a43833c696" }'

View File

@@ -254,21 +254,15 @@ if(coverage)
set(GCOVR_ADDITIONAL_ARGS --exclude-throw-branches -s)
setup_target_for_coverage_gcovr(
NAME
coverage_report
FORMAT
${CODE_COVERAGE_FORMAT}
EXECUTABLE
clio_tests
EXECUTABLE_ARGS
--gtest_brief=1
${TESTS_ADDITIONAL_ARGS}
NAME coverage_report
FORMAT ${CODE_COVERAGE_FORMAT}
EXECUTABLE clio_tests
EXECUTABLE_ARGS --gtest_brief=1 ${TESTS_ADDITIONAL_ARGS}
EXCLUDE
"tests"
"src/data/cassandra"
"src/data/CassandraBackend.hpp"
"src/data/BackendFactory.*"
DEPENDENCIES
clio_tests
"tests"
"src/data/cassandra"
"src/data/CassandraBackend.hpp"
"src/data/BackendFactory.*"
DEPENDENCIES clio_tests
)
endif()