From ce0361d55707cc84821e693731712e6f81a2a7dc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Nov 2025 17:55:05 -0500 Subject: Suppress pylint warnings in scripts and simplify lint tests --- lv2specgen/lv2docgen.py | 9 +++++++++ lv2specgen/lv2specgen.py | 33 +++++++++++++++++++++++++++++++++ test/meson.build | 15 +++++---------- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/lv2specgen/lv2docgen.py b/lv2specgen/lv2docgen.py index 9b1685a..2a0e2a2 100755 --- a/lv2specgen/lv2docgen.py +++ b/lv2specgen/lv2docgen.py @@ -3,6 +3,15 @@ # Copyright 2012 David Robillard # SPDX-License-Identifier: ISC +# pylint: disable=consider-using-f-string +# pylint: disable=invalid-name +# pylint: disable=missing-function-docstring +# pylint: disable=missing-module-docstring +# pylint: disable=pointless-string-statement +# pylint: disable=redefined-outer-name +# pylint: disable=unspecified-encoding +# pylint: disable=use-implicit-booleaness-not-len + import errno import os import sys diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 28c1500..00d8891 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -9,6 +9,39 @@ # Based on SpecGen: # +# pylint: disable=broad-exception-caught +# pylint: disable=c-extension-no-member +# pylint: disable=cell-var-from-loop +# pylint: disable=consider-iterating-dictionary +# pylint: disable=consider-using-f-string +# pylint: disable=deprecated-module +# pylint: disable=global-statement +# pylint: disable=global-variable-not-assigned +# pylint: disable=invalid-name +# pylint: disable=missing-function-docstring +# pylint: disable=missing-module-docstring +# pylint: disable=no-else-return +# pylint: disable=no-member +# pylint: disable=pointless-string-statement +# pylint: disable=possibly-used-before-assignment +# pylint: disable=redefined-argument-from-local +# pylint: disable=redefined-builtin +# pylint: disable=redefined-outer-name +# pylint: disable=too-many-arguments +# pylint: disable=too-many-boolean-expressions +# pylint: disable=too-many-branches +# pylint: disable=too-many-lines +# pylint: disable=too-many-locals +# pylint: disable=too-many-positional-arguments +# pylint: disable=too-many-statements +# pylint: disable=unspecified-encoding +# pylint: disable=unused-argument +# pylint: disable=use-implicit-booleaness-not-comparison +# pylint: disable=use-implicit-booleaness-not-len +# pylint: disable=use-maxsplit-arg +# pylint: disable=used-before-assignment +# pylint: disable=wrong-import-order + import datetime import markdown import markdown.extensions diff --git a/test/meson.build b/test/meson.build index cddb05a..5a2bcfb 100644 --- a/test/meson.build +++ b/test/meson.build @@ -99,17 +99,12 @@ endif ########## if get_option('lint') - # Scripts that don't pass with pylint - lax_python_scripts = files( + python_scripts = lv2_scripts + files( '../lv2specgen/lv2docgen.py', '../lv2specgen/lv2specgen.py', + '../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 - # Check script formatting black = find_program('black', required: get_option('tests')) if black.found() @@ -117,7 +112,7 @@ if get_option('lint') test( 'black', black, - args: black_opts + all_python_scripts, + args: black_opts + python_scripts, suite: 'scripts', ) endif @@ -125,7 +120,7 @@ if get_option('lint') # Check scripts for errors with flake8 flake8 = find_program('flake8', required: get_option('tests')) if flake8.found() - test('flake8', flake8, args: all_python_scripts, suite: 'scripts') + test('flake8', flake8, args: python_scripts, suite: 'scripts') endif # Check scripts for errors with pylint @@ -139,7 +134,7 @@ if get_option('lint') ) if lint_py.found() - test('pylint', pylint, args: strict_python_scripts, suite: 'scripts') + test('pylint', pylint, args: python_scripts, suite: 'scripts') endif endif endif -- cgit v1.2.1