Skip to content

Commit

Permalink
github-actions: Improve cppcheck accuracy
Browse files Browse the repository at this point in the history
Give it relevant -D/-I flags so it can perform more useful checks.
This makes if slower, but hopefully more accurate and useful.
  • Loading branch information
cwendling committed Nov 14, 2023
1 parent a2f0a4f commit 9babbf2
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
.

0 comments on commit 9babbf2

Please sign in to comment.