summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/features.txt282
-rw-r--r--examples/pylintrc10
-rw-r--r--man/pylint.112
3 files changed, 158 insertions, 146 deletions
diff --git a/doc/features.txt b/doc/features.txt
index 999a48a..bb6dbe5 100644
--- a/doc/features.txt
+++ b/doc/features.txt
@@ -48,11 +48,11 @@ Commands options
Messages control options
~~~~~~~~~~~~~~~~~~~~~~~~
:enable-checker:
- Enable only checker(s) with the given id(s). This option conflict with the
+ Enable only checker(s) with the given id(s). This option conflicts with the
disable-checker option
:disable-checker:
- Enable all checker(s) except those with the given id(s). This option conflict
- with the disable-checker option
+ Enable all checker(s) except those with the given id(s). This option
+ conflicts with the enable-checker option
:enable-msg-cat:
Enable all messages in the listed categories.
:disable-msg-cat:
@@ -135,11 +135,10 @@ Main reports
Basic checker
-------------
checks for :
-
* doc strings
* modules / classes / functions / methods / arguments / variables name
* number of arguments, local variables, branchs, returns and statements in
- functions, methods
+functions, methods
* required module attributes
* dangerous default values as arguments
* redefinition of function / method / class
@@ -236,7 +235,7 @@ Messages
Python offers now some cleaner alternative like list comprehension.
:W0142: *Used * or ** magic*
Used when a function or method is called using `*args` or `**kwargs` to
- dispatch arguments. This doesn't improve readility and should be used with
+ dispatch arguments. This doesn't improve readability and should be used with
care.
:C0102: *Black listed name "%s"*
Used when the name is listed in the black list (unauthorized names).
@@ -267,6 +266,10 @@ Options
Tells wether missing members accessed in mixin class should be ignored. A
mixin class is detected if its name ends with "mixin" (case insensitive).
Default: yes
+:ignored-classes:
+ List of classes names for which member attributes should not be checked
+ (useful for classes with attributes dynamicaly set).
+ Default: SQLObject
:zope:
When zope mode is activated, consider the acquired-members option to ignore
access to some undefined attributes.
@@ -338,7 +341,7 @@ Messages
:W0613: *Unused argument %r*
Used when a function or method argument is not used.
:W0614: *Unused import %s from wildcard import*
- Used when an imported module or variable is not used from a 'from X import \*'
+ Used when an imported module or variable is not used from a 'from X import *'
style import.
:W0621: *Redefining name %r from outer scope (line %s)*
Used when a variable's name hide a name defined in the outer scope.
@@ -349,6 +352,83 @@ Messages
or a generator expression) is used outside the loop.
+Newstyle checker
+----------------
+checks for usage of new style capabilities on old style classes and
+other new/old styles conflicts problems
+* use of property, __slots__, super
+* "super" usage
+* raising a new style class as exception
+
+Messages
+~~~~~~~~
+:E1001: *Use __slots__ on an old style class*
+ Used when an old style class use the __slots__ attribute.
+:E1002: *Use super on an old style class*
+ Used when an old style class use the super builtin.
+:E1003: *Bad first argument %r given to super class*
+ Used when another argument than the current class is given as first argument
+ of the super builtin.
+:E1010: *Raising a new style class*
+ Used when a new style class is raised since it's not possible with python <
+ 2.5.
+:W1001: *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
+:W1010: *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.
+
+
+Imports checker
+---------------
+checks for
+* external modules dependencies
+* relative / wildcard imports
+* cyclic imports
+* uses of deprecated modules
+
+Options
+~~~~~~~
+:deprecated-modules:
+ Deprecated modules which should not be used, separated by a comma
+ Default: regsub,string,TERMIOS,Bastion,rexec
+:import-graph:
+ Create a graph of every (i.e. internal and external) dependencies in the
+ given file (report R0402 must not be disabled)
+:ext-import-graph:
+ Create a graph of external dependencies in the given file (report R0402 must
+ not be disabled)
+:int-import-graph:
+ Create a graph of internal dependencies in the given file (report R0402 must
+ not be disabled)
+
+Messages
+~~~~~~~~
+:W0401: *Wildcard import %s*
+ Used when `from module import *` is detected.
+:W0402: *Uses of a deprecated module %r*
+ Used a module marked as deprecated is imported.
+:W0403: *Relative import %r*
+ Used when an import relative to the package directory is detected.
+:W0404: *Reimport %r (imported line %s)*
+ Used when a module is reimported multiple times.
+:W0406: *Module import itself*
+ Used when a module is importing itself.
+:W0410: *__future__ import is not the first non docstring statement*
+ Python 2.5 and greater require __future__ import to be the first non docstring
+ statement in the module.
+:R0401: *Cyclic import (%s)*
+ Used when a cyclic import between two or more modules is detected.
+:F0401: *Unable to import %r (%s)*
+ Used when pylint has been unable to import a module.
+
+Reports
+~~~~~~~
+:R0401: External dependencies
+:R0402: Modules dependencies graph
+
+
Classes checker
---------------
checks for :
@@ -499,83 +579,6 @@ Messages
Used when an interface class is not implemented anywhere.
-Imports checker
----------------
-checks for
-* external modules dependencies
-* relative / wildcard imports
-* cyclic imports
-* uses of deprecated modules
-
-Options
-~~~~~~~
-:deprecated-modules:
- Deprecated modules which should not be used, separated by a comma
- Default: regsub,string,TERMIOS,Bastion,rexec
-:import-graph:
- Create a graph of every (i.e. internal and external) dependencies in the
- given file (report R0402 must not be disabled)
-:ext-import-graph:
- Create a graph of external dependencies in the given file (report R0402 must
- not be disabled)
-:int-import-graph:
- Create a graph of internal dependencies in the given file (report R0402 must
- not be disabled)
-
-Messages
-~~~~~~~~
-:W0401: *Wildcard import %s*
- Used when `from module import *` is detected.
-:W0402: *Uses of a deprecated module %r*
- Used a module marked as deprecated is imported.
-:W0403: *Relative import %r*
- Used when an import relative to the package directory is detected.
-:W0404: *Reimport %r (imported line %s)*
- Used when a module is reimported multiple times.
-:W0406: *Module import itself*
- Used when a module is importing itself.
-:W0410: *__future__ import is not the first non docstring statement*
- Python 2.5 and greater require __future__ import to be the first non docstring
- statement in the module.
-:R0401: *Cyclic import (%s)*
- Used when a cyclic import between two or more modules is detected.
-:F0401: *Unable to import %r (%s)*
- Used when pylint has been unable to import a module.
-
-Reports
-~~~~~~~
-:R0401: External dependencies
-:R0402: Modules dependencies graph
-
-
-Newstyle checker
-----------------
-checks for usage of new style capabilities on old style classes and
-other new/old styles conflicts problems
-* use of property, __slots__, super
-* "super" usage
-* raising a new style class as exception
-
-Messages
-~~~~~~~~
-:E1001: *Use __slots__ on an old style class*
- Used when an old style class use the __slots__ attribute.
-:E1002: *Use super on an old style class*
- Used when an old style class use the super builtin.
-:E1003: *Bad first argument %r given to super class*
- Used when another argument than the current class is given as first argument
- of the super builtin.
-:E1010: *Raising a new style class*
- Used when a new style class is raised since it's not possible with python <
- 2.5.
-:W1001: *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
-:W1010: *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.
-
-
Exceptions checker
------------------
checks for
@@ -593,10 +596,10 @@ Messages
raised (i.e. a `TypeError` will be raised).
:W0701: *Raising a string exception*
Used when a string exception is raised.
-:W0702: *No exception's type specified*
+:W0702: *No exception type(s) specified*
Used when an except clause doesn't specify exceptions type to catch.
:W0703: *Catch "Exception"*
- Used when an except catch Exception instances.
+ Used when an except catches Exception instances.
:W0704: *Except doesn't do anything*
Used when an except clause does nothing but "pass" and there is no "else"
clause.
@@ -605,58 +608,6 @@ Messages
value which can't be used as an exception.
-Format checker
---------------
-checks for :
-* unauthorized constructions
-* strict indentation
-* line length
-* use of <> instead of !=
-
-Options
-~~~~~~~
-:max-line-length:
- Maximum number of characters on a single line.
- Default: 80
-:max-module-lines:
- Maximum number of lines in a module
- Default: 1000
-:indent-string:
- String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
- tab).
- Default: ' '
-
-Messages
-~~~~~~~~
-:W0311: *Bad indentation. Found %s %s, expected %s*
- Used when an unexpected number of indentation's tabulations or spaces has been
- found.
-:W0312: *Found indentation with %ss instead of %ss*
- Used when there are some mixed tabs and spaces in a module.
-:W0331: *Use of the <> operator*
- Used when the deprecated "<>" operator is used instead of "!=".
-:W0332: *Use l as long integer identifier*
- Used when a lower case "l" is used to mark a long integer. You should use a
- upper case "L" since the letter "l" looks too much like the digit "1"
-:C0301: *Line too long (%s/%s)*
- Used when a line is longer than a given number of characters.
-:C0302: *Too many lines in module (%s)*
- Used when a module has too much lines, reducing its readibility.
-:C0321: *More than one statement on a single line*
- Used when more than on statement are found on the same line.
-:C0322: *Operator not preceded by a space*
- Used when one of the following operator (!= | <= | == | >= | < | > | = | \+= |
- -= | \*= | /= | %) is not preceded by a space.
-:C0323: *Operator not followed by a space*
- Used when one of the following operator (!= | <= | == | >= | < | > | = | \+= |
- -= | \*= | /= | %) is not followed by a space.
-:C0324: *Comma not followed by a space*
- Used when a comma (",") is not followed by a space.
-:F0321: *Format detection error in %r*
- Used when an unexpected error occured in bad format detection. Please report
- the error if it occurs.
-
-
Miscellaneous checker
---------------------
checks for:
@@ -727,3 +678,58 @@ Reports
:R0801: Duplication
+Format checker
+--------------
+checks for :
+* unauthorized constructions
+* strict indentation
+* line length
+* use of <> instead of !=
+
+Options
+~~~~~~~
+:max-line-length:
+ Maximum number of characters on a single line.
+ Default: 80
+:max-module-lines:
+ Maximum number of lines in a module
+ Default: 1000
+:indent-string:
+ String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
+ tab).
+ Default: ' '
+
+Messages
+~~~~~~~~
+:W0311: *Bad indentation. Found %s %s, expected %s*
+ Used when an unexpected number of indentation's tabulations or spaces has been
+ found.
+:W0312: *Found indentation with %ss instead of %ss*
+ Used when there are some mixed tabs and spaces in a module.
+:W0331: *Use of the <> operator*
+ Used when the deprecated "<>" operator is used instead of "!=".
+:W0332: *Use l as long integer identifier*
+ Used when a lower case "l" is used to mark a long integer. You should use a
+ upper case "L" since the letter "l" looks too much like the digit "1"
+:W0333: *Use of the `` operator*
+ Used when the deprecated "``" (backtick) operator is used instead of the str()
+ function.
+:C0301: *Line too long (%s/%s)*
+ Used when a line is longer than a given number of characters.
+:C0302: *Too many lines in module (%s)*
+ Used when a module has too much lines, reducing its readibility.
+:C0321: *More than one statement on a single line*
+ Used when more than on statement are found on the same line.
+:C0322: *Operator not preceded by a space*
+ Used when one of the following operator (!= | <= | == | >= | < | > | = | \+= |
+ -= | \*= | /= | %) is not preceded by a space.
+:C0323: *Operator not followed by a space*
+ Used when one of the following operator (!= | <= | == | >= | < | > | = | \+= |
+ -= | \*= | /= | %) is not followed by a space.
+:C0324: *Comma not followed by a space*
+ Used when a comma (",") is not followed by a space.
+:F0321: *Format detection error in %r*
+ Used when an unexpected error occured in bad format detection.Please report
+ the error if it occurs.
+
+
diff --git a/examples/pylintrc b/examples/pylintrc
index a0786ab..56b0791 100644
--- a/examples/pylintrc
+++ b/examples/pylintrc
@@ -35,12 +35,12 @@ load-plugins=
[MESSAGES CONTROL]
-# Enable only checker(s) with the given id(s). This option conflict with the
+# Enable only checker(s) with the given id(s). This option conflicts with the
# disable-checker option
#enable-checker=
-# Enable all checker(s) except those with the given id(s). This option conflict
-# with the disable-checker option
+# Enable all checker(s) except those with the given id(s). This option
+# conflicts with the enable-checker option
#disable-checker=
# Enable all messages in the listed categories.
@@ -156,6 +156,10 @@ bad-functions=map,filter,apply,input
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamicaly set).
+ignored-classes=SQLObject
+
# When zope mode is activated, consider the acquired-members option to ignore
# access to some undefined attributes.
zope=no
diff --git a/man/pylint.1 b/man/pylint.1
index 64ced34..80ff28a 100644
--- a/man/pylint.1
+++ b/man/pylint.1
@@ -1,4 +1,4 @@
-.TH pylint 1 "2007-3-6" pylint
+.TH pylint 1 "2008-1-14" pylint
.SH NAME
.B pylint
\- python code static checker
@@ -64,9 +64,9 @@ Generate pylint's man page.
.SH MESSAGES CONTROL
.IP "--enable-checker=<checker ids>"
-Enable only checker(s) with the given id(s). This option conflict with the disable-checker option
+Enable only checker(s) with the given id(s). This option conflicts with the disable-checker option
.IP "--disable-checker=<checker ids>"
-Enable all checker(s) except those with the given id(s). This option conflict with the disable-checker option
+Enable all checker(s) except those with the given id(s). This option conflicts with the enable-checker option
.IP "--enable-msg-cat=<msg cats>"
Enable all messages in the listed categories.
.IP "--disable-msg-cat=<msg cats>"
@@ -183,6 +183,8 @@ Ignore docstrings when computing similarities. [current: %default]
.SH TYPECHECK
.IP "--ignore-mixin-members=<y_or_n>"
Tells wether missing members accessed in mixin class should be ignored. A mixin class is detected if its name ends with "mixin" (case insensitive). [current: %default]
+.IP "--ignored-classes=<members names>"
+List of classes names for which member attributes should not be checked (useful for classes with attributes dynamicaly set). [current: %default]
.IP "--zope=<y_or_n>"
When zope mode is activated, consider the acquired-members option to ignore access to some undefined attributes. [current: %default]
.IP "--acquired-members=<members names>"
@@ -223,8 +225,8 @@ There are 5 kind of message types :
/usr/share/doc/pythonX.Y-pylint/
.SH COPYRIGHT
-Copyright (c) 2003-2007 Sylvain Thenault (thenault@gmail.com).
-Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE).
+Copyright (c) 2003-2008 Sylvain Thenault (thenault@gmail.com).
+Copyright (c) 2003-2008 LOGILAB S.A. (Paris, FRANCE).
http://www.logilab.fr/ -- mailto:contact@logilab.fr
This program is free software; you can redistribute it and/or modify