[Buildbot-devel] Running Pylint on Buildbot's source code
Dustin J. Mitchell
dustin at v.igoro.us
Fri Jul 5 02:31:28 UTC 2013
Here's my take on these messages:
OK
--
:C0202 (bad-classmethod-argument): *Class method %s should have %s as
first argument*
Used when a class method has a first argument named differently than the value
specified in valid-classmethod-first-arg option (default to "cls"),
recommended to easily differentiate them from regular instance
methods. This message belongs to the classes checker.
:C0204 (bad-mcs-classmethod-argument): *Metaclass class method %s
should have %s as first argument*
Used when a metaclass class method has a first argument named differently than
the value specified in valid-metaclass-classmethod-first-arg option (default
to "mcs"), recommended to easily differentiate them from regular instance
methods. This message belongs to the classes checker.
:C0301 (line-too-long): *Line too long (%s/%s)*
Used when a line is longer than a given number of characters. This
message belongs to the format checker.
:C0321 (multiple-statements): *More than one statement on a single line*
Used when more than on statement are found on the same line. This
message belongs to the format checker.
:C0322 (no-space-before-operator): *Operator not preceded by a space*
Used when one of the following operator (!= | <= | == | >= | < | > | = | \+= |
-= | \*= | /= | %) is not preceded by a space. This message belongs
to the format checker.
:C0323 (no-space-after-operator): *Operator not followed by a space*
Used when one of the following operator (!= | <= | == | >= | < | > | = | \+= |
-= | \*= | /= | %) is not followed by a space. This message belongs
to the format checker.
:C0324 (no-space-after-comma): *Comma not followed by a space*
Used when a comma (",") is not followed by a space. This message
belongs to the format checker.
:E0101 (return-in-init): *Explicit return in __init__*
Used when the special class method __init__ has an explicit return
value. This message belongs to the basic checker.
:E0202 (method-hidden): *An attribute affected in %s line %s hide this method*
Used when a class defines a method which is hidden by an instance attribute
from an ancestor class or set by some client code. This message
belongs to the classes checker.
:E0203 (access-member-before-definition): *Access to member %r before
its definition line %s*
Used when an instance member is accessed before it's actually
assigned. This message belongs to the classes checker.
:E0603 (undefined-all-variable): *Undefined variable name %r in __all__*
Used when an undefined variable name is referenced in __all__. This
message belongs to the variables checker.
:E0611 (no-name-in-module): *No name %r in module %r*
Used when a name cannot be found in a module. This message belongs
to the variables checker.
:E1002 (super-on-old-class): *Use of super on an old style class*
Used when an old style class uses the super builtin. This message
belongs to the newstyle checker.
:E1101 (no-member): *%s %r has no %r member*
Used when a variable is accessed for an unexistent member. This
message belongs to the typecheck checker.
:E1102 (not-callable): *%s is not callable*
Used when an object being called has been inferred to a non callable
object This message belongs to the typecheck checker.
:E1111 (assignment-from-no-return): *Assigning to function call which
doesn't return*
Used when an assignment is done on a function call but the inferred function
doesn't return anything. This message belongs to the typecheck checker.
:E1120 (no-value-for-parameter): *No value passed for parameter %s in
function call*
Used when a function call passes too few arguments. This message
belongs to the typecheck checker.
:E1121 (too-many-function-args): *Too many positional arguments for
function call*
Used when a function call passes too many positional arguments. This
message belongs to the typecheck checker.
:E1123 (unexpected-keyword-arg): *Passing unexpected keyword argument
%r in function call*
Used when a function call passes a keyword argument that doesn't correspond to
one of the function's parameter names. This message belongs to the
typecheck checker.
:E1124 (redundant-keyword-arg): *Parameter %r passed as both
positional and keyword argument*
Used when a function call would result in assigning multiple values to a
function parameter, one value from a positional argument and one from a
keyword argument. This message belongs to the typecheck checker.
:F0401 (import-error): *Unable to import %s*
Used when pylint has been unable to import a module. This message
belongs to the imports checker.
:R0401 (cyclic-import): *Cyclic import (%s)*
Used when a cyclic import between two or more modules is detected.
This message belongs to the imports checker.
:W0101 (unreachable): *Unreachable code*
Used when there is some code behind a "return" or "raise" statement, which
will never be accessed. This message belongs to the basic checker.
:W0102 (dangerous-default-value): *Dangerous default value %s as argument*
Used when a mutable value as list or dictionary is detected in a default value
for an argument. This message belongs to the basic checker.
:W0104 (pointless-statement): *Statement seems to have no effect*
Used when a statement doesn't have (or at least seems to) any
effect. This message belongs to the basic checker.
:W0105 (pointless-string-statement): *String statement has no effect*
Used when a string is used as a statement (which of course has no effect).
This is a particular case of W0104 with its own message so you can easily
disable it if you're using those strings as documentation, instead of
comments. This message belongs to the basic checker.
:W0107 (unnecessary-pass): *Unnecessary pass statement*
Used when a "pass" statement that can be avoided is encountered.
This message belongs to the basic checker.
:W0108 (unnecessary-lambda): *Lambda may not be necessary*
Used when the body of a lambda expression is a function call on the same
argument list as the lambda itself; such lambda expressions are in all but a
few cases replaceable with the function being called in the body of the
lambda. This message belongs to the basic checker.
:W0109 (duplicate-key): *Duplicate key %r in dictionary*
Used when a dictionary expression binds the same key multiple times.
This message belongs to the basic checker.
:W0110 (deprecated-lambda): *map/filter on lambda could be replaced by
comprehension*
Used when a lambda is the first argument to "map" or "filter". It could be
clearer as a list comprehension or generator expression. This
message belongs to the basic checker.
:W0120 (useless-else-on-loop): *Else clause on loop without a break statement*
Loops should only have an else clause if they can exit early with a break
statement, otherwise the statements under else should be on the same scope as
the loop itself. This message belongs to the basic checker.
:W0141 (bad-builtin): *Used builtin function %r*
Used when a black listed builtin function is used (see the bad-function
option). Usual black listed functions are the ones like map, or filter , where
Python offers now some cleaner alternative like list comprehension.
This message belongs to the basic checker.
:W0201 (attribute-defined-outside-init): *Attribute %r defined outside __init__*
Used when an instance attribute is defined outside the __init__
method. This message belongs to the classes checker.
:W0212 (protected-access): *Access to a protected member %s of a client class*
Used when a protected member (i.e. class member with a name beginning with an
underscore) is access outside the class or a descendant of the class where
it's defined. This message belongs to the classes checker.
:W0221 (arguments-differ): *Arguments number differs from %s method*
Used when a method has a different number of arguments than in the implemented
interface or in an overridden method. This message belongs to the
classes checker.
:W0222 (signature-differs): *Signature differs from %s method*
Used when a method signature is different than in the implemented interface or
in an overridden method. This message belongs to the classes checker.
:W0223 (abstract-method): *Method %r is abstract in class %r but is
not overridden*
Used when an abstract method (i.e. raise NotImplementedError) is not
overridden in concrete class. This message belongs to the classes checker.
:W0231 (super-init-not-called): *__init__ method from base class %r is
not called*
Used when an ancestor class method has an __init__ method which is not called
by a derived class. This message belongs to the classes checker.
:W0232 (no-init): *Class has no __init__ method*
Used when a class has no __init__ method, neither its parent
classes. This message belongs to the classes checker.
:W0233 (non-parent-init-called): *__init__ method from a non direct
base class %r is called*
Used when an __init__ method is called on a class which is not in the direct
ancestors for the analysed class. This message belongs to the classes checker.
:W0301 (unnecessary-semicolon): *Unnecessary semicolon*
Used when a statement is ended by a semi-colon (";"), which isn't necessary
(that's python, not C ;). This message belongs to the format checker.
:W0311 (bad-indentation): *Bad indentation. Found %s %s, expected %s*
Used when an unexpected number of indentation's tabulations or spaces has been
found. This message belongs to the format checker.
:W0312 (mixed-indentation): *Found indentation with %ss instead of %ss*
Used when there are some mixed tabs and spaces in a module. This
message belongs to the format checker.
:W0333 (backtick): *Use of the `` operator*
Used when the deprecated "``" (backtick) operator is used instead of the str()
function. This message belongs to the format checker.
:W0403 (relative-import): *Relative import %r, should be %r*
Used when an import relative to the package directory is detected.
This message belongs to the imports checker.
:W0603 (global-statement): *Using the global statement*
Used when you use the "global" statement to update a global variable. PyLint
just try to discourage this usage. That doesn't mean you can not use
it ! This message belongs to the variables checker.
:W0611 (unused-import): *Unused import %s*
Used when an imported module or variable is not used. This message
belongs to the variables checker.
:W0612 (unused-variable): *Unused variable %r*
Used when a variable is defined but not used. This message belongs
to the variables checker.
:W0621 (redefined-outer-name): *Redefining name %r from outer scope (line %s)*
Used when a variable's name hide a name defined in the outer scope.
This message belongs to the variables checker.
:W0622 (redefined-builtin): *Redefining built-in %r*
Used when a variable or function override a built-in. This message
belongs to the variables checker.
:W0631 (undefined-loop-variable): *Using possibly undefined loop variable %r*
Used when an loop variable (i.e. defined by a for loop or a list comprehension
or a generator expression) is used outside the loop. This message
belongs to the variables checker.
:W0701 (raising-string): *Raising a string exception*
Used when a string exception is raised. This message belongs to the
exceptions checker.
:W0702 (bare-except): *No exception type(s) specified*
Used when an except clause doesn't specify exceptions type to catch.
This message belongs to the exceptions checker.
:W0703 (broad-except): *Catching too general exception %s*
Used when an except catches a too general exception, possibly burying
unrelated errors. This message belongs to the exceptions checker.
:W0710 (nonstandard-exception): *Exception doesn't inherit from
standard "Exception" class*
Used when a custom exception class is raised but doesn't inherit from the
builtin "Exception" class. This message belongs to the exceptions checker.
:W1001 (property-on-old-class): *Use of "property" on an old style class*
Used when PyLint detect the use of the builtin "property" on an old style
class while this is relying on new style classes features This
message belongs to the newstyle checker.
:W1401 (anomalous-backslash-in-string): *Anomalous backslash in
string: '%s'. String constant might be missing an r prefix.*
Used when a backslash is in a literal string but not as an escape.
This message belongs to the string_constant checker.
:W1402 (anomalous-unicode-escape-in-string): *Anomalous Unicode escape
in byte string: '%s'. String constant might be missing an r or u
prefix.*
Used when an escape like \u is encountered in a byte string where it has no
effect. This message belongs to the string_constant checker.
Ignore
------
:C0111 (missing-docstring): *Missing docstring*
Used when a module, function, class or method has no docstring. Some special
methods like __init__ doesn't necessary require a docstring. This
message belongs to the basic checker.
:C0112 (empty-docstring): *Empty docstring*
Used when a module, function, class or method has an empty docstring (it would
be too easy ;). This message belongs to the basic checker.
:C0302 (too-many-lines): *Too many lines in module (%s)*
Used when a module has too much lines, reducing its readability.
This message belongs to the format checker.
:R0201 (no-self-use): *Method could be a function*
Used when a method doesn't use its bound instance, and so could be written as
a function. This message belongs to the classes checker.
:R0801 (duplicate-code): *Similar lines in %s files*
Indicates that a set of similar lines has been detected among multiple file.
This usually means that the code should be refactored to avoid this
duplication. This message belongs to the similarities checker.
:R0901 (too-many-ancestors): *Too many ancestors (%s/%s)*
Used when class has too many parent classes, try to reduce this to get a more
simple (and so easier to use) class. This message belongs to the
design checker.
:R0902 (too-many-instance-attributes): *Too many instance attributes (%s/%s)*
Used when class has too many instance attributes, try to reduce this to get a
more simple (and so easier to use) class. This message belongs to
the design checker.
:R0903 (too-few-public-methods): *Too few public methods (%s/%s)*
Used when class has too few public methods, so be sure it's really
worth it. This message belongs to the design checker.
:R0904 (too-many-public-methods): *Too many public methods (%s/%s)*
Used when class has too many public methods, try to reduce this to get a more
simple (and so easier to use) class. This message belongs to the
design checker.
:R0911 (too-many-return-statements): *Too many return statements (%s/%s)*
Used when a function or method has too many return statement, making it hard
to follow. This message belongs to the design checker.
:R0912 (too-many-branches): *Too many branches (%s/%s)*
Used when a function or method has too many branches, making it hard to
follow. This message belongs to the design checker.
:R0913 (too-many-arguments): *Too many arguments (%s/%s)*
Used when a function or method takes too many arguments. This
message belongs to the design checker.
:R0914 (too-many-locals): *Too many local variables (%s/%s)*
Used when a function or method has too many local variables. This
message belongs to the design checker.
:R0915 (too-many-statements): *Too many statements (%s/%s)*
Used when a function or method has too many statements. You should then split
it in smaller functions / methods. This message belongs to the design checker.
:R0921 (abstract-class-not-used): *Abstract class not referenced*
Used when an abstract class is not used as ancestor anywhere. This
message belongs to the design checker.
:R0922 (abstract-class-little-used): *Abstract class is only
referenced %s times*
Used when an abstract class is used less than X times as ancestor.
This message belongs to the design checker.
:R0924 (incomplete-protocol): *Badly implemented %s, implements %s but not %s*
A class implements some of the special methods for a particular protocol, but
not all of them This message belongs to the design checker.
:W0106 (expression-not-assigned): *Expression "%s" is assigned to nothing*
Used when an expression that is not a function call is assigned to nothing.
Probably something else was intended. This message belongs to the
basic checker.
:W0122 (exec-statement): *Use of the exec statement*
Used when you use the "exec" statement, to discourage its usage. That doesn't
mean you can not use it ! This message belongs to the basic checker.
:W0142 (star-args): *Used * or ** magic*
Used when a function or method is called using `*args` or `**kwargs` to
dispatch arguments. This doesn't improve readability and should be used with
care. This message belongs to the basic checker.
:W0402 (deprecated-module): *Uses of a deprecated module %r*
Used a module marked as deprecated is imported. This message belongs
to the imports checker.
:W0511 (fixme):
Used when a warning note as FIXME or XXX is detected. This message
belongs to the miscellaneous checker.
:W0601 (global-variable-undefined): *Global variable %r undefined at
the module level*
Used when a variable is defined through the "global" statement but the
variable is not defined in the module scope. This message belongs to
the variables checker.
:W0613 (unused-argument): *Unused argument %r*
Used when a function or method argument is not used. This message
belongs to the variables checker.
:E1103 (maybe-no-member): *%s %r has no %r member (but some types
could not be inferred)*
Used when a variable is accessed for an unexistent member, but astng was not
able to interpret all possible types of this variable. This message
belongs to the typecheck checker.
Fix Parameters
--------------
:C0103 (invalid-name): *Invalid name "%s" for type %s (should match %s)*
Used when the name doesn't match the regular expression associated to its type
(constant, variable, class...). This message belongs to the basic checker.
Unsure
------
:C0102 (blacklisted-name): *Black listed name "%s"*
Used when the name is listed in the black list (unauthorized names).
This message belongs to the basic checker.
:E0102 (function-redefined): *%s already defined line %s*
Used when a function / class / method is redefined. This message
belongs to the basic checker.
*** pyflakes catches these, so I suspect anything pylint has found is
a false alarm?
:E0211 (no-method-argument): *Method has no argument*
Used when a method which should have the bound instance as first argument has
no argument defined. This message belongs to the classes checker.
*** this may be from the interfaces?
:E0213 (no-self-argument): *Method should have "self" as first argument*
Used when a method has an attribute different the "self" as first argument.
This is considered as an error since this is a so common convention that you
shouldn't break it! This message belongs to the classes checker.
*** this may be from the interfaces?
More information about the devel
mailing list