From 40d98e4f4299e6da6455ff415d961de73db39e27 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 3 Apr 2023 09:00:38 -0400 Subject: Add pylint test --- test/meson.build | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/meson.build b/test/meson.build index 0104079f..a4de9090 100644 --- a/test/meson.build +++ b/test/meson.build @@ -8,8 +8,11 @@ wrapper = meson.get_external_property('exe_wrapper', '') # Scripts and Metadata # ######################## -python_scripts = files( +plot_scripts = files( '../scripts/serd_bench.py', +) + +simple_scripts = files( 'run_suite.py', 'serd_test_util/__init__.py', 'test_quiet.py', @@ -17,6 +20,8 @@ python_scripts = files( 'test_write_error.py', ) +python_scripts = simple_scripts + plot_scripts + if get_option('lint') # Check release metadata if not meson.is_subproject() @@ -52,6 +57,25 @@ if get_option('lint') if flake8.found() test('flake8', flake8, args: python_scripts, suite: 'scripts') endif + + # Check scripts for errors with pylint + pylint = find_program('pylint', required: false) + if pylint.found() + pymod = import('python') + plot_py = pymod.find_installation( + 'python3', + modules: ['matplotlib'], + required: false, + ) + + pylint_scripts = simple_scripts + if plot_py.found() + pylint_scripts += plot_scripts + endif + + pylint_args = ['--disable', 'bad-option-value'] + test('pylint', pylint, args: pylint_args + pylint_scripts, suite: 'scripts') + endif endif ################### -- cgit v1.2.1