Convert pylint to a meson feature

Enable by default if it's found.
This commit is contained in:
Mario Limonciello 2024-02-14 22:53:27 -06:00 committed by Mario Limonciello
parent 3d509fa6d2
commit e9f26f965f
5 changed files with 7 additions and 7 deletions

View file

@ -60,7 +60,7 @@ build_stable:
--fatal-meson-warnings
--warnlevel 2
-Dgtk_doc=true
-Dpylint=true
-Dpylint=enabled
-Dmanpage=enabled
-Db_coverage=true
_build

View file

@ -49,8 +49,8 @@ gnome = import('gnome')
add_global_arguments('-D_GNU_SOURCE=1', language: 'c')
add_global_arguments(common_cflags, language: 'c')
if get_option('pylint')
pylint = find_program('pylint-3', 'pylint3', 'pylint', required: true)
pylint = find_program('pylint-3', 'pylint3', 'pylint', required: get_option('pylint'))
if pylint.found()
nomalloc = environment({'MALLOC_PERTURB_': '0'})
pylint_flags = ['-d', 'C0116', '-d', 'C0114', '-d', 'W0707', '-d', 'W0706' ]
endif

View file

@ -7,8 +7,8 @@ option('gtk_doc',
value: false,
description: 'Build docs')
option('pylint',
type: 'boolean',
value: false,
type: 'feature',
value: 'auto',
description: 'Run pylint checks, for developers only')
option('tests',
description: 'Whether to run tests',

View file

@ -108,7 +108,7 @@ powerprofilesctl = files('powerprofilesctl')
install_data(powerprofilesctl,
install_dir: get_option('bindir')
)
if get_option('pylint')
if pylint.found()
test('pylint-powerprofilesctl',
pylint,
args: pylint_flags + [ powerprofilesctl ],

View file

@ -76,7 +76,7 @@ foreach ut: unit_tests
)
endforeach
if get_option('pylint')
if pylint.found()
integration_pylint_flags = ['-d', 'W0511', '-d', 'C0302'] + pylint_flags
test('pylint-integration-tests',
pylint,