From 9babbf277b07af6975781a506d988562634ca695 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Tue, 14 Nov 2023 21:32:57 +0100 Subject: [PATCH] github-actions: Improve cppcheck accuracy Give it relevant -D/-I flags so it can perform more useful checks. This makes if slower, but hopefully more accurate and useful. --- .github/workflows/build.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17ace93ba..318606c84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -231,5 +231,35 @@ jobs: sudo apt-get install --assume-yes --no-install-recommends \ cppcheck ${DEB_LIBRARY_DEPS} ${DEB_LIBRARY_DEPS_MATE_DESKTOP} + # - ignore non-source directories + # - define relevant configuration I can think of + # - X11-related stuff + # - Wayland-related stuff + # - in-process for Wayland + # - optional features + # - -I flags from pkg-config (grepped from configure.ac) - name: cppcheck - run: cppcheck --enable=warning,style,performance,portability,information,missingInclude -i'gtk-layer-shell-build' . + env: + checks: warning,style,performance,portability,information,missingInclude + defines: > + -DHAVE_X11 -DHAVE_RANDR + -DHAVE_WAYLAND + -DCLOCK_INPROCESS -DFISH_INPROCESS -DNOTIFICATION_AREA_INPROCESS -DWNCKLET_INPROCESS + -DHAVE_WINDOW_PREVIEWS + packages: > + gdk-pixbuf-2.0 + gio-unix-2.0 + gmodule-2.0 + gtk+-3.0 + ice + libwnck-3.0 + mate-desktop-2.0 + sm + run: | + cppcheck --enable=${{env.checks}} \ + -j ${{env.JOBS}} \ + ${{env.defines}} \ + $(pkg-config --cflags-only-I ${{env.packages}}) \ + -i'gtk-layer-shell-build' \ + -i'mate-panel/mate-submodules' \ + .