From 425cffc2f7001030c97f7b671255afc3ea7df15e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 9 Apr 2015 07:43:47 +0200 Subject: [PATCH] pylint: Ignore 'undefined-variable' for tests. It's less than optimal, but disabling it selectively because of https://bitbucket.org/logilab/pylint/issue/511/ is too annoying. --- scripts/run_pylint_on_tests.py | 9 +++++++-- tests/config/test_configtypes.py | 15 --------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/scripts/run_pylint_on_tests.py b/scripts/run_pylint_on_tests.py index 94ba89c7d..792eaf7a6 100644 --- a/scripts/run_pylint_on_tests.py +++ b/scripts/run_pylint_on_tests.py @@ -46,8 +46,13 @@ def main(): for fn in filenames: if os.path.splitext(fn)[1] == '.py': files.append(os.path.join(dirpath, fn)) - disabled = ['attribute-defined-outside-init', 'redefined-outer-name', - 'unused-argument'] + disabled = [ + 'attribute-defined-outside-init', + 'redefined-outer-name', + 'unused-argument', + # https://bitbucket.org/logilab/pylint/issue/511/ + 'undefined-variable', + ] no_docstring_rgx = ['^__.*__$', '^setup$'] args = (['--disable={}'.format(','.join(disabled)), '--no-docstring-rgx=({})'.format('|'.join(no_docstring_rgx))] + diff --git a/tests/config/test_configtypes.py b/tests/config/test_configtypes.py index 0b6ea21b7..08a095177 100644 --- a/tests/config/test_configtypes.py +++ b/tests/config/test_configtypes.py @@ -328,9 +328,6 @@ class TestBool: """Test Bool.""" - # https://bitbucket.org/logilab/pylint/issue/511/ - # pylint: disable=undefined-variable - TESTS = {True: ['1', 'yes', 'YES', 'true', 'TrUe', 'on'], False: ['0', 'no', 'NO', 'false', 'FaLsE', 'off']} @@ -942,9 +939,6 @@ class TestColorSystem: """Test ColorSystem.""" - # https://bitbucket.org/logilab/pylint/issue/511/ - # pylint: disable=undefined-variable - TESTS = { 'RGB': QColor.Rgb, 'rgb': QColor.Rgb, @@ -1109,9 +1103,6 @@ class TestFont: """Test Font/QtFont.""" - # https://bitbucket.org/logilab/pylint/issue/511/ - # pylint: disable=undefined-variable - TESTS = { # (style, weight, pointsize, pixelsize, family '"Foobar Neue"': @@ -1960,9 +1951,6 @@ class TestAutoSearch: """Test AutoSearch.""" - # https://bitbucket.org/logilab/pylint/issue/511/ - # pylint: disable=undefined-variable - TESTS = { 'naive': ['naive', 'NAIVE'] + TestBool.TESTS[True], 'dns': ['dns', 'DNS'], @@ -2012,9 +2000,6 @@ class TestIgnoreCase: """Test IgnoreCase.""" - # https://bitbucket.org/logilab/pylint/issue/511/ - # pylint: disable=undefined-variable - TESTS = { 'smart': ['smart', 'SMART'], True: TestBool.TESTS[True],