summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-01-10 11:47:32 -0500
committerDavid Robillard <d@drobilla.net>2025-01-10 11:47:32 -0500
commitd8a1f1dcc7094f91e75ff5a6cd468889aea4a703 (patch)
tree49672c79d7353d89507c62cd28518aa9ffdaf9d8
parent4b8a5ae465009a3bd5fe3ff77c7402eea20648eb (diff)
downloadpatchage-main.tar.gz
patchage-main.tar.bz2
patchage-main.zip
Use cppcheck working directoryHEADmain
This allows for better analysis, and adds a cache to improve checking times, especially on repeated runs.
-rw-r--r--lint/meson.build47
-rw-r--r--meson.build44
2 files changed, 48 insertions, 43 deletions
diff --git a/lint/meson.build b/lint/meson.build
new file mode 100644
index 0000000..48e736d
--- /dev/null
+++ b/lint/meson.build
@@ -0,0 +1,47 @@
+# Copyright 2020-2024 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR GPL-3.0-or-later
+
+if not meson.is_subproject()
+ # Check release metadata
+ autoship = find_program('autoship', required: false)
+ if autoship.found()
+ test(
+ 'autoship',
+ autoship,
+ args: ['test', patchage_src_root],
+ suite: 'data',
+ )
+ endif
+
+ # Check code with cppcheck
+ cppcheck = find_program('cppcheck', required: false)
+ if cppcheck.found()
+ compdb_path = join_paths(patchage_build_root, 'compile_commands.json')
+ suppress_path = join_paths(patchage_src_root, '.suppress.cppcheck')
+ test(
+ 'cppcheck',
+ cppcheck,
+ args: [
+ '--enable=warning,style,performance,portability',
+ '--error-exitcode=1',
+ '--project=' + compdb_path,
+ '--suppressions-list=' + suppress_path,
+ '-DPATCHAGE_DISABLE_FMT_WARNINGS=',
+ '-q',
+ ],
+ suite: 'code',
+ timeout: 60,
+ )
+ endif
+endif
+
+# Check licensing metadata
+reuse = find_program('reuse', required: false)
+if reuse.found()
+ test(
+ 'REUSE',
+ reuse,
+ args: ['--root', patchage_src_root, 'lint'],
+ suite: 'data',
+ )
+endif
diff --git a/meson.build b/meson.build
index 6eb66ca..93cf950 100644
--- a/meson.build
+++ b/meson.build
@@ -316,49 +316,7 @@ install_man(files('doc/patchage.1'))
#########
if get_option('lint')
- if not meson.is_subproject()
- # Check release metadata
- autoship = find_program('autoship', required: false)
- if autoship.found()
- test(
- 'autoship',
- autoship,
- args: ['test', patchage_src_root],
- suite: 'data',
- )
- endif
-
- # Check code with cppcheck
- cppcheck = find_program('cppcheck', required: false)
- if cppcheck.found()
- compdb_path = join_paths(patchage_build_root, 'compile_commands.json')
- suppress_path = join_paths(patchage_src_root, '.suppress.cppcheck')
- test(
- 'cppcheck',
- cppcheck,
- args: [
- '--enable=warning,style,performance,portability',
- '--error-exitcode=1',
- '--project=' + compdb_path,
- '--suppressions-list=' + suppress_path,
- '-q',
- ],
- suite: 'code',
- timeout: 60,
- )
- endif
- endif
-
- # Check licensing metadata
- reuse = find_program('reuse', required: false)
- if reuse.found()
- test(
- 'REUSE',
- reuse,
- args: ['--root', patchage_src_root, 'lint'],
- suite: 'data',
- )
- endif
+ subdir('lint')
endif
if not meson.is_subproject()