From 5f6e04cdee0a1d0a43b0f0d2ddee5f176a0af264 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Sep 2024 11:11:54 -0400 Subject: Fix whitespace and add clang-format test --- meson.build | 20 ++++++++++---------- src/jalv_qt.cpp | 2 +- test/meson.build | 44 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 54 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index dc3b206..83cc36d 100644 --- a/meson.build +++ b/meson.build @@ -275,18 +275,18 @@ endif # Programs # ############ -sources = ( - backend_sources + files( - 'src/control.c', - 'src/jalv.c', - 'src/log.c', - 'src/lv2_evbuf.c', - 'src/state.c', - 'src/symap.c', - 'src/worker.c', - ) +common_sources = files( + 'src/control.c', + 'src/jalv.c', + 'src/log.c', + 'src/lv2_evbuf.c', + 'src/state.c', + 'src/symap.c', + 'src/worker.c', ) +sources = backend_sources + common_sources + common_dependencies = [ backend_dep, lilv_dep, diff --git a/src/jalv_qt.cpp b/src/jalv_qt.cpp index 54af169..acfbcdb 100644 --- a/src/jalv_qt.cpp +++ b/src/jalv_qt.cpp @@ -197,7 +197,7 @@ FlowLayout::sizeHint() const QSize FlowLayout::minimumSize() const { - QSize size = {}; + QSize size = {}; for (QLayoutItem* const item : itemList) { size = size.expandedTo(item->minimumSize()); } diff --git a/test/meson.build b/test/meson.build index d7d0e94..43083cf 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,6 +1,37 @@ -# Copyright 2019-2022 David Robillard +# Copyright 2019-2024 David Robillard # SPDX-License-Identifier: 0BSD OR ISC +######## +# Lint # +######## + +all_sources = ( + common_sources + files( + '../src/attributes.h', + '../src/backend.h', + '../src/control.h', + '../src/frontend.h', + '../src/jack.c', + '../src/jalv_config.h', + '../src/jalv_console.c', + '../src/jalv_gtk.c', + '../src/jalv_internal.h', + '../src/jalv_qt.cpp', + '../src/jalv_qt.hpp', + '../src/log.h', + '../src/lv2_evbuf.h', + '../src/nodes.h', + '../src/options.h', + '../src/port.h', + '../src/portaudio.c', + '../src/state.h', + '../src/symap.h', + '../src/types.h', + '../src/urids.h', + '../src/worker.h', + ) +) + if get_option('lint') if not meson.is_subproject() # Check release metadata @@ -25,6 +56,17 @@ if get_option('lint') suite: 'data', ) endif + + # Check code formatting + clang_format = find_program('clang-format', required: false) + if clang_format.found() + test( + 'format', + clang_format, + args: ['--Werror', '--dry-run'] + all_sources, + suite: 'code', + ) + endif endif ############## -- cgit v1.2.1