meson: wire up static analysis via Coccinelle

Wire up static analysis via Coccinelle via a new test target
"coccicheck". This target can be executed via `meson compile coccicheck`
and generates the semantic patch for us.

Note that we don't hardcode the list of source and header files that
shall be analyzed, and instead use git-ls-files(1) to find them for us.
This is because we also want to analyze files that may not get built on
the current platform, so finding all sources at configure time is easier
than introducing a new variable that tracks all sources, including those
which aren't being built.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-02-18 08:45:56 +01:00
committed by Junio C Hamano
parent e9e924e581
commit c1d6628c94
3 changed files with 92 additions and 0 deletions

View File

@ -2,4 +2,5 @@ foreach feature : get_option('contrib')
subdir(feature)
endforeach
subdir('coccinelle')
subdir('credential')