The linter is impossible to maintain, because it is not possible to parse C++ with a simple regex. When it produces nonsense, like https://github.com/bitcoin/bitcoin/runs/27958379841, it is mostly annoying, because the code is perfectly fine, but the red CI is a blocker for the pull request. Also, fixing it isn’t trivially possible, so the only solution is to juggle with the code until the regex in the linter is pleased.
It would be better to write it as a clang-tidy plugin, however that isn’t ideal either, because that will (normally) only run in CI and takes a long time.
Ideally, it is implemented in consteval
C++, directly in the source code. (Similar to Rust std::fmt
or C++20 std::format
, but they aren’t available yet on supported compilers and would be a breaking change in all format strings anyway)