From 60b153b94107c7064420d13a5c38b32a155870b1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 7 Aug 2022 11:40:08 -0400 Subject: Only run flake8/pylint/black tests with strict option enabled Older versions of these tools can cause issues, but they are only useful for development anyway. So, just disable them by default to avoid build issues for users on ancient systems. --- test/meson.build | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/test/meson.build b/test/meson.build index fe85e74..bd0f0d5 100644 --- a/test/meson.build +++ b/test/meson.build @@ -81,32 +81,34 @@ endif # Python # ########## -flake8 = find_program('flake8', required: get_option('tests')) -pylint = find_program('pylint', required: get_option('tests')) -black = find_program('black', required: get_option('tests')) - -# Scripts that don't pass with pylint -lax_python_scripts = files( - '../lv2specgen/lv2docgen.py', - '../lv2specgen/lv2specgen.py', -) +if get_option('strict') + flake8 = find_program('flake8', required: get_option('tests')) + pylint = find_program('pylint', required: get_option('tests')) + black = find_program('black', required: get_option('tests')) + + # Scripts that don't pass with pylint + lax_python_scripts = files( + '../lv2specgen/lv2docgen.py', + '../lv2specgen/lv2specgen.py', + ) -# Scripts that pass with everything including pylint -strict_python_scripts = lv2_scripts + files('../plugins/literasc.py') + # Scripts that pass with everything including pylint + strict_python_scripts = lv2_scripts + files('../plugins/literasc.py') -all_python_scripts = lax_python_scripts + strict_python_scripts + all_python_scripts = lax_python_scripts + strict_python_scripts -if is_variable('black') and black.found() - black_opts = ['-l', '79', '-q', '--check'] - test('black', black, args: black_opts + all_python_scripts, suite: 'scripts') -endif + if is_variable('black') and black.found() + black_opts = ['-l', '79', '-q', '--check'] + test('black', black, args: black_opts + all_python_scripts, suite: 'scripts') + endif -if is_variable('flake8') and flake8.found() - test('flake8', flake8, args: all_python_scripts, suite: 'scripts') -endif + if is_variable('flake8') and flake8.found() + test('flake8', flake8, args: all_python_scripts, suite: 'scripts') + endif -if is_variable('pylint') and pylint.found() - test('pylint', pylint, args: strict_python_scripts, suite: 'scripts') + if is_variable('pylint') and pylint.found() + test('pylint', pylint, args: strict_python_scripts, suite: 'scripts') + endif endif ############## -- cgit v1.2.1