aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-07 11:40:08 -0400
committerDavid Robillard <d@drobilla.net>2022-08-07 11:40:08 -0400
commit60b153b94107c7064420d13a5c38b32a155870b1 (patch)
tree6bc590549a8d065ecc99cd79d87075c1896ffc9a
parentd3550a59cc2f474b142bc2a7076d2f1b3af92c40 (diff)
downloadlv2-60b153b94107c7064420d13a5c38b32a155870b1.tar.xz
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.
-rw-r--r--test/meson.build44
1 files 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
##############