Fix pylint old-style-class errors

This patch fixes the errors noted by pylint where
classes are defined in an older style (old-style-class).

The following errors were resolved:

************* Module bandit.core.config
C: 30, 0: Old-style class defined. (old-style-class)
************* Module bandit.core.context
C: 24, 0: Old-style class defined. (old-style-class)
************* Module bandit.core.manager
C: 37, 0: Old-style class defined. (old-style-class)
************* Module bandit.core.meta_ast
C: 25, 0: Old-style class defined. (old-style-class)
************* Module bandit.core.test_set
C: 30, 0: Old-style class defined. (old-style-class)
C: 77, 8: Old-style class defined. (old-style-class)
************* Module bandit.core.tester
C: 29, 0: Old-style class defined. (old-style-class)

Change-Id: I48728844fd259c1e08bad5e4aa6f65352fdd0ff2
This commit is contained in:
Eric Brown
2016-11-29 22:31:17 -08:00
parent 1bbb7d5073
commit 8dc5384835
7 changed files with 8 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ from bandit.core import utils
LOG = logging.getLogger(__name__)
class BanditConfig():
class BanditConfig(object):
def __init__(self, config_file=None):
'''Attempt to initialize a config dictionary from a yaml file.

View File

@@ -21,7 +21,7 @@ import six
from bandit.core import utils
class Context():
class Context(object):
def __init__(self, context_object=None):
'''Initialize the class with a context, empty dict otherwise

View File

@@ -34,7 +34,7 @@ from bandit.core import test_set as b_test_set
LOG = logging.getLogger(__name__)
class BanditManager():
class BanditManager(object):
scope = []

View File

@@ -22,7 +22,7 @@ import logging
LOG = logging.getLogger(__name__)
class BanditMetaAst():
class BanditMetaAst(object):
nodes = collections.OrderedDict()

View File

@@ -27,7 +27,7 @@ from bandit.core import extension_loader
LOG = logging.getLogger(__name__)
class BanditTestSet():
class BanditTestSet(object):
def __init__(self, config, profile=None):
if not profile:
profile = {}
@@ -74,7 +74,7 @@ class BanditTestSet():
def _load_builtins(self, filtering, profile):
'''loads up builtin functions, so they can be filtered.'''
class Wrapper:
class Wrapper(object):
def __init__(self, name, plugin):
self.name = name
self.plugin = plugin

View File

@@ -26,7 +26,7 @@ warnings.formatwarning = utils.warnings_formatter
LOG = logging.getLogger(__name__)
class BanditTester():
class BanditTester(object):
def __init__(self, testset, debug, nosec_lines):
self.results = []
self.testset = testset

View File

@@ -11,7 +11,6 @@
# TODO(browne): fix these in the future
# C0103: invalid-name
# C1001: old-style-class
# E1101: no-member
# R0204: redefined-variable-type
# R0902: too-many-instance-attributes
@@ -30,7 +29,7 @@
# W0613: unused-argument
# W0621: redefined-outer-name
# W0703: broad-except
disable=C0111,C0301,C0325,C1001,F0401,W0511,W0142,W0622,C0103,E1101,R0204,R0902,R0911,R0912,R0913,R0914,R0915,W0110,W0141,W0201,W0401,W0603,W0212,W0612,W0613,W0621,W0703
disable=C0111,C0301,C0325,F0401,W0511,W0142,W0622,C0103,E1101,R0204,R0902,R0911,R0912,R0913,R0914,R0915,W0110,W0141,W0201,W0401,W0603,W0212,W0612,W0613,W0621,W0703
[Basic]
# Variable names can be 1 to 31 characters long, with lowercase and underscores