diff options
author | David Robillard <d@drobilla.net> | 2023-04-03 09:00:38 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-04-06 07:19:10 -0400 |
commit | 40d98e4f4299e6da6455ff415d961de73db39e27 (patch) | |
tree | 90e5a6439db3d1d3e89f00097577851ce7f1ef26 | |
parent | ab712f8f0ea58f1a36aced42332ed8d8ffab83d7 (diff) | |
download | serd-40d98e4f4299e6da6455ff415d961de73db39e27.tar.gz serd-40d98e4f4299e6da6455ff415d961de73db39e27.tar.bz2 serd-40d98e4f4299e6da6455ff415d961de73db39e27.zip |
Add pylint test
-rw-r--r-- | doc/meson.build | 2 | ||||
-rw-r--r-- | 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 ################### |