meson.build: add black and ruff checks to the test suite

We still have the separate CI jobs for those (for better visibility) but
also optionally incorporate those into the meson test run.

Both calls only check the files, they do not modify anything.
This commit is contained in:
Peter Hutterer 2023-03-02 10:45:47 +10:00
parent a806968ec5
commit ba8bead183

View file

@ -244,6 +244,22 @@ if build_oeffis
dependencies: [dep_libutil, dep_liboeffis])
endif
black = find_program('black', required: false)
if black.found()
test('python-black', black,
args: ['--check', meson.project_source_root(), meson.project_source_root() / 'proto' / 'ei-scanner'],
suite: 'python',
)
endif
ruff = find_program('ruff', required: false)
if ruff.found()
test('python-ruff', ruff,
args: ['check', '--ignore=E741,E501', meson.project_source_root(), meson.project_source_root() / 'proto' / 'ei-scanner'],
suite: 'python',
)
endif
# tests
if get_option('tests')
subdir('test')