summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--meson.build1
-rw-r--r--test/meson.build14
3 files changed, 17 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 071b177..13548b7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
sratom (0.6.17) unstable; urgency=medium
+ * Add lint option with project metadata and code formatting tests
* Enable clang nullability checks
* Fix library current_version on MacOS
- -- David Robillard <d@drobilla.net> Thu, 14 Mar 2024 17:00:24 +0000
+ -- David Robillard <d@drobilla.net> Sun, 06 Oct 2024 17:37:06 +0000
sratom (0.6.16) stable; urgency=medium
diff --git a/meson.build b/meson.build
index 767322d..48f4675 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,7 @@ project(
)
sratom_src_root = meson.current_source_dir()
+sratom_build_root = meson.current_build_dir()
major_version = meson.project_version().split('.')[0]
version_suffix = '-@0@'.format(major_version)
versioned_name = 'sratom' + version_suffix
diff --git a/test/meson.build b/test/meson.build
index 337f26d..1e8b08f 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -38,6 +38,20 @@ if get_option('lint')
if autoship.found()
test('autoship', autoship, args: ['test', sratom_src_root], suite: 'data')
endif
+
+ # Check code with cppcheck
+ cppcheck = find_program('cppcheck', required: false)
+ if cppcheck.found()
+ compdb_path = join_paths(sratom_build_root, 'compile_commands.json')
+ cppcheck_args = [
+ '--enable=warning,style,performance,portability',
+ '--error-exitcode=1',
+ '--project=' + compdb_path,
+ '--suppress=normalCheckLevelMaxBranches',
+ '-q',
+ ]
+ test('cppcheck', cppcheck, args: cppcheck_args, suite: 'code')
+ endif
endif
# Check licensing metadata