From 8fe82c63998547e1d63fc88ad1b4ae15de51c12f Mon Sep 17 00:00:00 2001 From: ammann <161159040+agammann@users.noreply.github.com> Date: Tue, 15 Sep 2026 22:00:04 -0700 Subject: [PATCH] ci: fail on unsupported JSON initializer patterns --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57e303c16..977d0be7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,8 +31,8 @@ test_format: extends: .debian-image stage: lint script: - - if grep 'json({}' src/*pp; then echo "The json brace initializer ctor is not supported by some compilers, use j_empty instead"; echo exit 1; fi - - if grep -P '^ +nlohmann::json [a-z0-9_]+\({}' src/*pp; then echo "The json brace initializer ctor is not supported by some compilers, use j_empty instead"; echo exit 1; fi + - if grep 'json({}' src/*pp; then echo "The json brace initializer ctor is not supported by some compilers, use j_empty instead"; exit 1; fi + - if grep -P '^ +nlohmann::json [a-z0-9_]+\({}' src/*pp; then echo "The json brace initializer ctor is not supported by some compilers, use j_empty instead"; exit 1; fi - ./tools/format.sh && git diff --exit-code