meson: Rework clang-tidy integration to be done via unit tests

Instead of using run-clang-tidy.py with its own scheduling, let's
just gather a list of source files ourselves and then use that to
add a unit test for each source file that runs clang-tidy on the
source file.

We also add a bit of logic to run clang-tidy on most header files
as well for extra coverage. This uncovered various header files that
were not standalone so this commit also includes fixes to make sure
the clang-tidy tests are all green.

We can also use this in a later commit to run clang-include-cleaner
on each source file in the same way.
This commit is contained in:
Daan De Meyer
2025-05-20 10:29:59 +02:00
parent 6196e414a5
commit d86fead481
21 changed files with 76 additions and 27 deletions
+1
View File
@@ -317,6 +317,7 @@ ethtool_link_mode_h = custom_target(
generated_sources += ethtool_link_mode_h
shared_sources += ethtool_link_mode_h
sources += shared_sources
fname = 'ethtool-link-mode.xml'
ethtool_link_mode_xml = custom_target(
+1
View File
@@ -7,6 +7,7 @@
Author: Auke Kok <auke-jan.h.kok@intel.com>
***/
#include <errno.h>
#include <stdbool.h>
#include <sys/types.h>
+1
View File
@@ -4,6 +4,7 @@
#include <stdbool.h>
#include <sys/types.h>
#include "assert-util.h"
#include "time-util.h"
#if ENABLE_UTMP