summaryrefslogtreecommitdiffstats
path: root/scripts/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-18 12:48:08 -0400
committerDavid Robillard <d@drobilla.net>2022-08-18 12:48:08 -0400
commitf83fb4a252b4eeef1c8b5696e2d604a946385e82 (patch)
tree05b5d59ce7ea7649f9aab296008ec62eaa1e7a03 /scripts/meson.build
parent5f0dd782d7deca9b34aba578bd5c9f5fb22eb5bd (diff)
downloadzix-f83fb4a252b4eeef1c8b5696e2d604a946385e82.tar.gz
zix-f83fb4a252b4eeef1c8b5696e2d604a946385e82.tar.bz2
zix-f83fb4a252b4eeef1c8b5696e2d604a946385e82.zip
Clean up Python scripts
Diffstat (limited to 'scripts/meson.build')
-rw-r--r--scripts/meson.build27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/meson.build b/scripts/meson.build
new file mode 100644
index 0000000..c303ae4
--- /dev/null
+++ b/scripts/meson.build
@@ -0,0 +1,27 @@
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: CC0-1.0 OR ISC
+
+if get_option('strict') and not meson.is_subproject()
+ 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 pass with everything including pylint
+ scripts = files(
+ 'benchmark.py',
+ 'plot.py',
+ )
+
+ if is_variable('black') and black.found()
+ black_opts = ['-l', '79', '-q', '--check']
+ test('black', black, args: black_opts + scripts, suite: 'scripts')
+ endif
+
+ if is_variable('flake8') and flake8.found()
+ test('flake8', flake8, args: scripts, suite: 'scripts')
+ endif
+
+ if is_variable('pylint') and pylint.found()
+ test('pylint', pylint, args: scripts, suite: 'scripts')
+ endif
+endif