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 --- doc/meson.build | 2 +- test/meson.build | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index ccd9426e..c57751a2 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -32,7 +32,7 @@ endif mandoc = find_program('mandoc', required: false) mandoc_css = files('mandoc.css') -if not get_option('tests').disabled() +if get_option('lint') stylelint = find_program('stylelint', required: false) if stylelint.found() test('stylelint', stylelint, args: [mandoc_css], suite: 'data') 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