From: Artem Bityutskiy Date: Tue, 5 Nov 2013 08:40:19 +0000 (+0200) Subject: Silence all uninteresting pylint recommendations X-Git-Tag: v3.1~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b598fd31fb80b1b82d215a3d650c52f8a583b64;p=tools%2Fbmap-tools.git Silence all uninteresting pylint recommendations Pylint produces many recommendations, but sometimes they are not very interesting and I am not planning to change the code to fulfill them. For all such cases, let's silence them. There are also a couple of false-positive warnings like 'unable to import backports', silence them too. Change-Id: Iac0a778877a6a71b9f28465d10c77b902a6b474e Signed-off-by: Artem Bityutskiy --- diff --git a/bmaptool b/bmaptool index 3780a74..96d485a 100755 --- a/bmaptool +++ b/bmaptool @@ -44,7 +44,11 @@ also contribute to the mapped blocks and are also copied. # Disable the following pylint recommendations: # * Too few public methods (R0903) +# * Too many statements (R0915) +# * Too many branches (R0912) # pylint: disable=R0903 +# pylint: disable=R0915 +# pylint: disable=R0912 VERSION = "3.0" diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index 5c9e5dc..ebce45a 100644 --- a/bmaptools/BmapCopy.py +++ b/bmaptools/BmapCopy.py @@ -45,7 +45,11 @@ also contribute to the mapped blocks and are also copied. # Disable the following pylint recommendations: # * Too many instance attributes (R0902) +# * Too many arguments - R0913 +# * Too many statements (R0915) # pylint: disable=R0902 +# pylint: disable=R0913 +# pylint: disable=R0915 import os import stat diff --git a/bmaptools/TransRead.py b/bmaptools/TransRead.py index ff7f74d..b7c575d 100644 --- a/bmaptools/TransRead.py +++ b/bmaptools/TransRead.py @@ -26,8 +26,12 @@ import logging # false-positives for many of 'subprocess' class members, e.g. # "Instance of 'Popen' has no 'wait' member". # * Too many instance attributes (R0902) +# * Too many branches (R0912) +# * Too many local variables (R0914) # pylint: disable=E1101 # pylint: disable=R0902 +# pylint: disable=R0912 +# pylint: disable=R0914 # A list of supported compression types SUPPORTED_COMPRESSION_TYPES = ('bz2', 'gz', 'xz', 'tar.gz', 'tgz', 'tar.bz2', @@ -314,7 +318,7 @@ class TransRead: import lzma except ImportError: try: - from backports import lzma + from backports import lzma # pylint: disable=F0401 except ImportError: raise Error("cannot import the \"lzma\" python module, " "it's required for decompressing .xz files") diff --git a/tests/test_api_base.py b/tests/test_api_base.py index 1379e12..ee60164 100644 --- a/tests/test_api_base.py +++ b/tests/test_api_base.py @@ -19,8 +19,12 @@ file and the copy and verifies that they are identical. """ # Disable the following pylint recommendations: -# * Too many public methods - R0904 +# * Too many public methods (R0904) +# * Too many local variables (R0914) +# * Too many statements (R0915) # pylint: disable=R0904 +# pylint: disable=R0914 +# pylint: disable=R0915 import os import tempfile @@ -30,7 +34,7 @@ import random # This is a work-around for Centos 6 try: - import unittest2 as unittest + import unittest2 as unittest # pylint: disable=F0401 except ImportError: import unittest @@ -78,7 +82,7 @@ def _generate_compressed_files(file_path, delete=True): import lzma except ImportError: try: - from backports import lzma + from backports import lzma # pylint: disable=F0401 except ImportError: lzma_present = False @@ -272,7 +276,7 @@ class TestCreateCopy(unittest.TestCase): function for different sparse files. """ - def test(self): + def test(self): # pylint: disable=R0201 """ The test entry point. Executes the '_do_test()' function for files of different sizes, holes distribution and format. diff --git a/tests/test_compat.py b/tests/test_compat.py index ea8e606..3ceb225 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -18,8 +18,11 @@ This unit test verifies various compatibility aspects of the BmapCopy module: """ # Disable the following pylint recommendations: -# * Too many public methods - R0904 +# * Too many public methods (R0904) +# * Attribute 'XYZ' defined outside __init__ (W0201), because unittest +# classes are not supposed to have '__init__()' # pylint: disable=R0904 +# pylint: disable=W0201 import os import shutil @@ -38,7 +41,7 @@ _OLDCODEBASE_SUBDIR = "oldcodebase" # This is a work-around for Centos 6 try: - import unittest2 as unittest + import unittest2 as unittest # pylint: disable=F0401 except ImportError: import unittest @@ -135,7 +138,7 @@ class TestCreateCopy(unittest.TestCase): if supported_ver >= bmap_version: writer = old_bmapcopy_class(self._f_image, self._f_copy, f_bmap) writer.copy(True, True) - except: + except: # pylint: disable=W0702 if supported_ver >= bmap_version_major: # The BmapCopy which we are testing is supposed to support this # version of bmap file format. However, bmap format version 1.4 diff --git a/tests/test_fiemap.py b/tests/test_fiemap.py index d9ab85c..621aa72 100644 --- a/tests/test_fiemap.py +++ b/tests/test_fiemap.py @@ -28,7 +28,7 @@ import itertools # This is a work-around for Centos 6 try: - import unittest2 as unittest + import unittest2 as unittest # pylint: disable=F0401 except ImportError: import unittest @@ -123,7 +123,7 @@ class TestCreateCopy(unittest.TestCase): function for different sparse files. """ - def test(self): + def test(self): # pylint: disable=R0201 """ The test entry point. Executes the '_do_test()' function for files of different sizes, holes distribution and format.