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 cc840d1
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,36 @@ jobs:
sudo apt-get install --assume-yes --no-install-recommends \
cppcheck ${DEB_LIBRARY_DEPS} ${DEB_LIBRARY_DEPS_MATE_DESKTOP}
# - 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)
# - ignore non-source directories
- 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
-DGETTEXT_PACKAGE='"mate-panel"'
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="$checks" \
-j $JOBS \
$defines \
$(pkg-config --cflags-only-I $packages) \
-i gtk-layer-shell-build \
-i mate-panel/mate-submodules/ \
.

0 comments on commit cc840d1

Please sign in to comment.