Skip to content

Commit ff89632

Browse files
authored
Update Gersemi and make it fail on warnings (#7842)
1 parent 7836a81 commit ff89632

6 files changed

Lines changed: 23 additions & 31 deletions

File tree

.gersemirc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/0.26.1/gersemi/configuration.schema.json
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/0.27.0/gersemi/configuration.schema.json
22

33
definitions:
44
- cmake/gersemi_definitions.cmake

CMakeLists.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ include(${CCF_DIR}/cmake/evercbor.cmake)
192192

193193
# Launcher library
194194
list(
195-
APPEND
196-
CCF_LAUNCHER_SOURCES
195+
APPEND CCF_LAUNCHER_SOURCES
197196
${CCF_DIR}/src/host/run.cpp
198197
${CCF_DIR}/src/host/env.cpp
199198
)
@@ -363,8 +362,7 @@ configure_file(
363362
install(FILES ${CCF_DIR}/include/ccf/version.h DESTINATION include/ccf)
364363

365364
file(
366-
READ
367-
${CCF_DIR}/doc/host_config_schema/cchost_config.json
365+
READ ${CCF_DIR}/doc/host_config_schema/cchost_config.json
368366
HOST_CONFIG_SCHEMA
369367
)
370368
set_property(
@@ -380,8 +378,7 @@ configure_file(
380378
)
381379

382380
file(
383-
READ
384-
${CCF_DIR}/doc/schemas/gov/2023-06-01-preview/gov.json
381+
READ ${CCF_DIR}/doc/schemas/gov/2023-06-01-preview/gov.json
385382
GOV_API_SCHEMA_2023_06_01_PREVIEW
386383
)
387384
set_property(
@@ -392,8 +389,7 @@ set_property(
392389
${CCF_DIR}/doc/schemas/gov/2023-06-01-preview/gov.json
393390
)
394391
file(
395-
READ
396-
${CCF_DIR}/doc/schemas/gov/2024-07-01/gov.json
392+
READ ${CCF_DIR}/doc/schemas/gov/2024-07-01/gov.json
397393
GOV_API_SCHEMA_2024_07_01
398394
)
399395
set_property(
@@ -1417,8 +1413,7 @@ if(BUILD_TESTS)
14171413
endforeach()
14181414
string(REPLACE ";" "\n" _cov_binaries_nl "${_cov_binaries}")
14191415
file(
1420-
GENERATE OUTPUT
1421-
"${CMAKE_BINARY_DIR}/coverage_binaries.txt"
1416+
GENERATE OUTPUT "${CMAKE_BINARY_DIR}/coverage_binaries.txt"
14221417
CONTENT "${_cov_binaries_nl}\n"
14231418
)
14241419
endif()

cmake/ccf_app.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ endif()
1515
# Enclave library wrapper
1616
function(add_ccf_app name)
1717
cmake_parse_arguments(
18-
PARSE_ARGV
19-
1
18+
PARSE_ARGV 1
2019
PARSED_ARGS
2120
""
2221
""

cmake/common.cmake

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ endfunction()
8585
# Helper for building end-to-end function tests using the python infrastructure
8686
function(add_e2e_test)
8787
cmake_parse_arguments(
88-
PARSE_ARGV
89-
0
88+
PARSE_ARGV 0
9089
PARSED_ARGS
9190
""
9291
"NAME;PYTHON_SCRIPT;LABEL;CURL_CLIENT"
@@ -190,8 +189,7 @@ endfunction()
190189
# Helper for building end-to-end perf tests using the python infrastucture
191190
function(add_piccolo_test)
192191
cmake_parse_arguments(
193-
PARSE_ARGV
194-
0
192+
PARSE_ARGV 0
195193
PARSED_ARGS
196194
""
197195
"NAME;PYTHON_SCRIPT;CONSTITUTION;CLIENT_BIN;PERF_LABEL"
@@ -233,8 +231,7 @@ endfunction()
233231
# Picobench wrapper
234232
function(add_picobench name)
235233
cmake_parse_arguments(
236-
PARSE_ARGV
237-
1
234+
PARSE_ARGV 1
238235
PARSED_ARGS
239236
""
240237
""

cmake/gersemi_definitions.cmake

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
function(add_ccf_app name)
99
cmake_parse_arguments(
10-
PARSE_ARGV
11-
1
10+
PARSE_ARGV 1
1211
PARSED_ARGS
1312
""
1413
""
@@ -22,8 +21,7 @@ endfunction()
2221

2322
function(add_e2e_test)
2423
cmake_parse_arguments(
25-
PARSE_ARGV
26-
0
24+
PARSE_ARGV 0
2725
PARSED_ARGS
2826
""
2927
"NAME;PYTHON_SCRIPT;LABEL;CURL_CLIENT"
@@ -33,8 +31,7 @@ endfunction()
3331

3432
function(add_piccolo_test)
3533
cmake_parse_arguments(
36-
PARSE_ARGV
37-
0
34+
PARSE_ARGV 0
3835
PARSED_ARGS
3936
""
4037
"NAME;PYTHON_SCRIPT;CONSTITUTION;CLIENT_BIN;PERF_LABEL"
@@ -44,8 +41,7 @@ endfunction()
4441

4542
function(add_picobench name)
4643
cmake_parse_arguments(
47-
PARSE_ARGV
48-
1
44+
PARSE_ARGV 1
4945
PARSED_ARGS
5046
""
5147
""
@@ -56,6 +52,9 @@ endfunction()
5652
function(add_test_bin name)
5753
endfunction()
5854

55+
function(add_fuzz_test name)
56+
endfunction()
57+
5958
function(add_unit_test name)
6059
endfunction()
6160

@@ -77,8 +76,7 @@ endfunction()
7776
# Third-party: Corrosion (corrosion-rs/corrosion)
7877
function(corrosion_import_crate)
7978
cmake_parse_arguments(
80-
PARSE_ARGV
81-
0
79+
PARSE_ARGV 0
8280
PARSED_ARGS
8381
""
8482
"MANIFEST_PATH;PROFILE"

scripts/check-cmake-format.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ if [ ! -x "$(command -v uv)" ]; then
3333
exit 1
3434
fi
3535

36-
GERSEMI="uvx gersemi@0.17.0"
36+
GERSEMI="uvx gersemi@0.27.0 --warnings-as-errors"
3737

3838
FILES=$(git ls-files "$@" | grep -e '\.cmake$' -e 'CMakeLists\.txt$')
3939

4040
if $fix ; then
4141
# shellcheck disable=SC2086
42-
$GERSEMI -i $FILES
42+
if ! $GERSEMI -i $FILES; then
43+
echo "Formatting failed (unknown commands or other warnings treated as errors)"
44+
exit 1
45+
fi
4346
echo "All files formatted!"
4447
else
4548
# shellcheck disable=SC2086

0 commit comments

Comments
 (0)