Change from numeric to symbolic pylint error codes
This commit is contained in:
@@ -41,16 +41,19 @@ load-plugins=
|
|||||||
# can either give multiple identifier separated by comma (,) or put this option
|
# can either give multiple identifier separated by comma (,) or put this option
|
||||||
# multiple time (only on the command line, not in the configuration file where
|
# multiple time (only on the command line, not in the configuration file where
|
||||||
# it should appear only once).
|
# it should appear only once).
|
||||||
disable=W0704,C0103,W0231,E1102,W0511,W0142,R0902,R0903,R0904,R0913,R0914,R0801,I0011,C0326
|
disable=pointless-except, invalid-name, super-init-not-called, fixme, star-args,
|
||||||
|
too-many-instance-attributes, too-few-public-methods, too-many-arguments,
|
||||||
|
too-many-locals, too-many-public-methods, duplicate-code, bad-whitespace,
|
||||||
|
locally-disabled
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
|
||||||
# Set the output format. Available formats are text, parseable, colorized, msvs
|
# Set the output format. Available formats are text, parseable, colorized, msvs
|
||||||
# (visual studio) and html
|
# (visual studio) and html
|
||||||
output-format=colorized
|
output-format=colorized
|
||||||
|
msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
|
||||||
|
|
||||||
# Include message's id in outpu
|
# Include message's id in output
|
||||||
include-ids=yes
|
include-ids=yes
|
||||||
|
|
||||||
# Put messages in a separate file for each module / package specified on the
|
# Put messages in a separate file for each module / package specified on the
|
||||||
@@ -191,7 +194,7 @@ additional-builtins=
|
|||||||
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
|
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
|
||||||
|
|
||||||
# List of method names used to declare (i.e. assign) instance attributes.
|
# List of method names used to declare (i.e. assign) instance attributes.
|
||||||
defining-attr-methods=__init__,__new__,setUp
|
defining-attr-methods=__init__,__new__,setUp,build
|
||||||
|
|
||||||
|
|
||||||
# checks for sign of poor/misdesign:
|
# checks for sign of poor/misdesign:
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ DOCDIRS = doc/html doc/latex
|
|||||||
PDF = doc/latex/refman.pdf
|
PDF = doc/latex/refman.pdf
|
||||||
|
|
||||||
CFLAGS += -Wall -Wextra
|
CFLAGS += -Wall -Wextra
|
||||||
PLFMT = --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
|
PLFMT =
|
||||||
|
# was: --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
|
||||||
|
|
||||||
all: codecheck test
|
all: codecheck test
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -181,14 +181,13 @@ class RemoteMixin( object ):
|
|||||||
if self.isRemote:
|
if self.isRemote:
|
||||||
kwargs.update( mnopts='-c' )
|
kwargs.update( mnopts='-c' )
|
||||||
super( RemoteMixin, self ).startShell( *args, **kwargs )
|
super( RemoteMixin, self ).startShell( *args, **kwargs )
|
||||||
if self.splitInit:
|
# Optional split initialization
|
||||||
self.sendCmd( 'echo $$' )
|
self.sendCmd( 'echo $$' )
|
||||||
else:
|
if not self.splitInit:
|
||||||
self.pid = int( self.cmd( 'echo $$' ) )
|
self.finishInit()
|
||||||
|
|
||||||
def finishInit( self ):
|
def finishInit( self ):
|
||||||
"Wait for split initialization to complete"
|
"Wait for split initialization to complete"
|
||||||
assert self # please pylint
|
|
||||||
self.pid = int( self.waitOutput() )
|
self.pid = int( self.waitOutput() )
|
||||||
|
|
||||||
def rpopen( self, *cmd, **opts ):
|
def rpopen( self, *cmd, **opts ):
|
||||||
@@ -283,7 +282,9 @@ class RemoteOVSSwitch( RemoteMixin, OVSSwitch ):
|
|||||||
"Is remote switch using an old OVS version?"
|
"Is remote switch using an old OVS version?"
|
||||||
cls = type( self )
|
cls = type( self )
|
||||||
if self.server not in cls.OVSVersions:
|
if self.server not in cls.OVSVersions:
|
||||||
|
# pylint: disable=not-callable
|
||||||
vers = self.cmd( 'ovs-vsctl --version' )
|
vers = self.cmd( 'ovs-vsctl --version' )
|
||||||
|
# pylint: enable=not-callable
|
||||||
cls.OVSVersions[ self.server ] = re.findall(
|
cls.OVSVersions[ self.server ] = re.findall(
|
||||||
r'\d+\.\d+', vers )[ 0 ]
|
r'\d+\.\d+', vers )[ 0 ]
|
||||||
return ( StrictVersion( cls.OVSVersions[ self.server ] ) <
|
return ( StrictVersion( cls.OVSVersions[ self.server ] ) <
|
||||||
|
|||||||
+5
-10
@@ -93,11 +93,6 @@ class CLI( Cmd ):
|
|||||||
self.locals.update( self.mn )
|
self.locals.update( self.mn )
|
||||||
return self.locals
|
return self.locals
|
||||||
|
|
||||||
# Disable pylint "Unused argument: 'arg's'" messages, as well as
|
|
||||||
# "method could be a function" warning, since each CLI function
|
|
||||||
# must have the same interface
|
|
||||||
# pylint: disable=R0201
|
|
||||||
|
|
||||||
helpStr = (
|
helpStr = (
|
||||||
'You may also send a command to a node using:\n'
|
'You may also send a command to a node using:\n'
|
||||||
' <node> command {args}\n'
|
' <node> command {args}\n'
|
||||||
@@ -139,10 +134,11 @@ class CLI( Cmd ):
|
|||||||
def do_sh( self, line ):
|
def do_sh( self, line ):
|
||||||
"""Run an external shell command
|
"""Run an external shell command
|
||||||
Usage: sh [cmd args]"""
|
Usage: sh [cmd args]"""
|
||||||
|
assert self # satisfy pylint and allow override
|
||||||
call( line, shell=True )
|
call( line, shell=True )
|
||||||
|
|
||||||
# do_py() and do_px() need to catch any exception during eval()/exec()
|
# do_py() and do_px() need to catch any exception during eval()/exec()
|
||||||
# pylint: disable=W0703
|
# pylint: disable=broad-except
|
||||||
|
|
||||||
def do_py( self, line ):
|
def do_py( self, line ):
|
||||||
"""Evaluate a Python expression.
|
"""Evaluate a Python expression.
|
||||||
@@ -159,7 +155,7 @@ class CLI( Cmd ):
|
|||||||
output( str( e ) + '\n' )
|
output( str( e ) + '\n' )
|
||||||
|
|
||||||
# We are in fact using the exec() pseudo-function
|
# We are in fact using the exec() pseudo-function
|
||||||
# pylint: disable=W0122
|
# pylint: disable=exec-used
|
||||||
|
|
||||||
def do_px( self, line ):
|
def do_px( self, line ):
|
||||||
"""Execute a Python statement.
|
"""Execute a Python statement.
|
||||||
@@ -169,7 +165,7 @@ class CLI( Cmd ):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
output( str( e ) + '\n' )
|
output( str( e ) + '\n' )
|
||||||
|
|
||||||
# pylint: enable=W0703,W0122
|
# pylint: enable=broad-except,exec-used
|
||||||
|
|
||||||
def do_pingall( self, line ):
|
def do_pingall( self, line ):
|
||||||
"Ping between all hosts."
|
"Ping between all hosts."
|
||||||
@@ -284,6 +280,7 @@ class CLI( Cmd ):
|
|||||||
|
|
||||||
def do_exit( self, _line ):
|
def do_exit( self, _line ):
|
||||||
"Exit"
|
"Exit"
|
||||||
|
assert self # satisfy pylint and allow override
|
||||||
return 'exited by user command'
|
return 'exited by user command'
|
||||||
|
|
||||||
def do_quit( self, line ):
|
def do_quit( self, line ):
|
||||||
@@ -398,8 +395,6 @@ class CLI( Cmd ):
|
|||||||
else:
|
else:
|
||||||
error( '*** Unknown command: %s\n' % line )
|
error( '*** Unknown command: %s\n' % line )
|
||||||
|
|
||||||
# pylint: enable=R0201
|
|
||||||
|
|
||||||
def waitForNode( self, node ):
|
def waitForNode( self, node ):
|
||||||
"Wait for a node to finish, and print its output."
|
"Wait for a node to finish, and print its output."
|
||||||
# Pollers
|
# Pollers
|
||||||
|
|||||||
+3
-3
@@ -124,8 +124,8 @@ class MininetLogger( Logger, object ):
|
|||||||
self.setLevel( level )
|
self.setLevel( level )
|
||||||
self.handlers[ 0 ].setLevel( level )
|
self.handlers[ 0 ].setLevel( level )
|
||||||
|
|
||||||
# pylint: disable=E0202
|
# pylint: disable=method-hidden
|
||||||
# "An attribute inherited from mininet.log hide this method"
|
# "An attribute inherited from mininet.log hide this method" (sic)
|
||||||
# Not sure why this is occurring - this function definitely gets called.
|
# Not sure why this is occurring - this function definitely gets called.
|
||||||
|
|
||||||
# See /usr/lib/python2.5/logging/__init__.py; modified from warning()
|
# See /usr/lib/python2.5/logging/__init__.py; modified from warning()
|
||||||
@@ -142,7 +142,7 @@ class MininetLogger( Logger, object ):
|
|||||||
if self.isEnabledFor( OUTPUT ):
|
if self.isEnabledFor( OUTPUT ):
|
||||||
self._log( OUTPUT, msg, args, kwargs )
|
self._log( OUTPUT, msg, args, kwargs )
|
||||||
|
|
||||||
# pylint: enable=E0202
|
# pylint: enable=method-hidden
|
||||||
|
|
||||||
lg = MininetLogger()
|
lg = MininetLogger()
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -254,9 +254,9 @@ class Mininet( object ):
|
|||||||
if isinstance( name, Controller ):
|
if isinstance( name, Controller ):
|
||||||
controller_new = name
|
controller_new = name
|
||||||
# Pylint thinks controller is a str()
|
# Pylint thinks controller is a str()
|
||||||
# pylint: disable=E1103
|
# pylint: disable=maybe-no-member
|
||||||
name = controller_new.name
|
name = controller_new.name
|
||||||
# pylint: enable=E1103
|
# pylint: enable=maybe-no-member
|
||||||
else:
|
else:
|
||||||
controller_new = controller( name, **params )
|
controller_new = controller( name, **params )
|
||||||
# Add new controller to net
|
# Add new controller to net
|
||||||
|
|||||||
+2
-2
@@ -289,7 +289,7 @@ class Topo( object ):
|
|||||||
|
|
||||||
|
|
||||||
# Our idiom defines additional parameters in build(param...)
|
# Our idiom defines additional parameters in build(param...)
|
||||||
# pylint: disable=arguments-differ, attribute-defined-outside-init
|
# pylint: disable=arguments-differ
|
||||||
|
|
||||||
class SingleSwitchTopo( Topo ):
|
class SingleSwitchTopo( Topo ):
|
||||||
"Single switch connected to k hosts."
|
"Single switch connected to k hosts."
|
||||||
@@ -345,4 +345,4 @@ class LinearTopo( Topo ):
|
|||||||
self.addLink( switch, lastSwitch )
|
self.addLink( switch, lastSwitch )
|
||||||
lastSwitch = switch
|
lastSwitch = switch
|
||||||
|
|
||||||
# pylint: enable=arguments-differ, attribute-defined-outside-init
|
# pylint: enable=arguments-differ
|
||||||
|
|||||||
+3
-3
@@ -3,8 +3,8 @@
|
|||||||
from mininet.topo import Topo
|
from mininet.topo import Topo
|
||||||
from mininet.net import Mininet
|
from mininet.net import Mininet
|
||||||
|
|
||||||
# The build() method is expected to do both of these things:
|
# The build() method is expected to do this:
|
||||||
# pylint: disable=attribute-defined-outside-init, arguments-differ
|
# pylint: disable=arguments-differ
|
||||||
|
|
||||||
class TreeTopo( Topo ):
|
class TreeTopo( Topo ):
|
||||||
"Topology for a tree network with a given depth and fanout."
|
"Topology for a tree network with a given depth and fanout."
|
||||||
@@ -69,4 +69,4 @@ class TorusTopo( Topo ):
|
|||||||
self.addLink( sw1, sw2 )
|
self.addLink( sw1, sw2 )
|
||||||
self.addLink( sw1, sw3 )
|
self.addLink( sw1, sw3 )
|
||||||
|
|
||||||
# pylint: enable=attribute-defined-outside-init, arguments-differ
|
# pylint: enable=arguments-differ
|
||||||
|
|||||||
+4
-5
@@ -25,7 +25,7 @@ def checkRun( cmd ):
|
|||||||
return check_call( cmd.split( ' ' ) )
|
return check_call( cmd.split( ' ' ) )
|
||||||
|
|
||||||
# pylint doesn't understand explicit type checking
|
# pylint doesn't understand explicit type checking
|
||||||
# pylint: disable=E1103
|
# pylint: disable=maybe-no-member
|
||||||
|
|
||||||
def oldQuietRun( *cmd ):
|
def oldQuietRun( *cmd ):
|
||||||
"""Run a command, routing stderr to stdout, and return the output.
|
"""Run a command, routing stderr to stdout, and return the output.
|
||||||
@@ -119,8 +119,7 @@ def quietRun( cmd, **kwargs ):
|
|||||||
"Run a command and return merged stdout and stderr"
|
"Run a command and return merged stdout and stderr"
|
||||||
return errRun( cmd, stderr=STDOUT, **kwargs )[ 0 ]
|
return errRun( cmd, stderr=STDOUT, **kwargs )[ 0 ]
|
||||||
|
|
||||||
# pylint: enable=E1103
|
# pylint: enable=maybe-no-member
|
||||||
# pylint: disable=E1101
|
|
||||||
|
|
||||||
def isShellBuiltin( cmd ):
|
def isShellBuiltin( cmd ):
|
||||||
"Return True if cmd is a bash builtin."
|
"Return True if cmd is a bash builtin."
|
||||||
@@ -133,8 +132,6 @@ def isShellBuiltin( cmd ):
|
|||||||
|
|
||||||
isShellBuiltin.builtIns = None
|
isShellBuiltin.builtIns = None
|
||||||
|
|
||||||
# pylint: enable=E1101
|
|
||||||
|
|
||||||
# Interface management
|
# Interface management
|
||||||
#
|
#
|
||||||
# Interfaces are managed as strings which are simply the
|
# Interfaces are managed as strings which are simply the
|
||||||
@@ -431,6 +428,8 @@ def fixLimits():
|
|||||||
except Exception:
|
except Exception:
|
||||||
warn( "*** Error setting resource limits. "
|
warn( "*** Error setting resource limits. "
|
||||||
"Mininet's performance may be affected.\n" )
|
"Mininet's performance may be affected.\n" )
|
||||||
|
# pylint: enable=broad-except
|
||||||
|
|
||||||
|
|
||||||
def mountCgroups():
|
def mountCgroups():
|
||||||
"Make sure cgroups file system is mounted"
|
"Make sure cgroups file system is mounted"
|
||||||
|
|||||||
Reference in New Issue
Block a user