Anonymous avatar Anonymous committed 9d6d61f

[svn] PyLint run.

Comments (0)

Files changed (9)

pygments/__init__.py

 def cmdline_main(args):
     """
     Make pygments usable as a command line utility.
-    XXX: To be removed.
+    TODO: To be removed in Pygments 0.8.
     """
     from pygments.cmdline import main
     return main(args)

pygments/filter.py

     automatically creates subclasses of this class for
     functions passed to it.
     """
+    function = None
 
     def __init__(self, **options):
         if not hasattr(self, 'function'):

pygments/filters/__init__.py

     words.
     """
     def __init__(self, **options):
-        Filter.__init__(self)
+        Filter.__init__(self, **options)
         tags = get_list_opt(options, 'codetags',
                             ['XXX', 'TODO', 'BUG', 'NOTE'])
         self.tag_re = re.compile(r'(%s)' % '|'.join([
     """
 
     def __init__(self, **options):
+        Filter.__init__(self, **options)
         self.words = set(get_list_opt(options, 'highlight', []))
         highlight_token = options.get('highlight_token')
         if highlight_token:

pygments/formatters/terminal.py

     :license: BSD, see LICENSE for more details.
 """
 
-import os
-
 from pygments.formatter import Formatter
 from pygments.token import Keyword, Name, Comment, String, Error, \
      Number, Operator, Generic, Token

pygments/lexers/text.py

 except NameError:
     from sets import Set as set
 
-from pygments.lexer import Lexer, RegexLexer, bygroups, include, using, this
+from pygments.lexer import RegexLexer, bygroups, include, using, this
 from pygments.token import Punctuation, \
     Text, Comment, Keyword, Name, String, Generic, Operator, Number
 
     *New in Pygments 0.7.*
     """
 
-    name= 'Debian Sourcelist'
+    name = 'Debian Sourcelist'
     aliases = ['sourceslist', 'sources.list']
     filenames = ['sources.list']
     mimetype = ['application/x-debian-sourceslist']

pygments/plugin.py

 
 
 def find_plugin_filters():
-    if pkg_recources is None:
+    if pkg_resources is None:
         return
     for entrypoint in pkg_resources.iter_entry_points(FILTER_ENTRY_POINT):
         yield entrypoint.name, entrypoint.load()

pygments/styles/fruity.py

 
 from pygments.style import Style
 from pygments.token import Token, Comment, Name, Keyword, \
-    Generic, Number, Operator, String
+    Generic, Number, String
 
 class FruityStyle(Style):
 

pygments/token.py

 if __name__ == '__main__':
     import sys
     # sanity check for token name dict: no duplicate entries!
-    s = STANDARD_TYPES.copy()
-    s[Token] = '---' # Token and Text do conflict, that is okay
+    stp = STANDARD_TYPES.copy()
+    stp[Token] = '---' # Token and Text do conflict, that is okay
     t = {}
-    for k, v in s.iteritems():
+    for k, v in stp.iteritems():
         t.setdefault(v, []).append(k)
-    if len(t) == len(s):
+    if len(t) == len(stp):
         print 'Okay!'
         sys.exit()
 
 # * handle message activation / deactivation at the module level
 # * handle some basic but necessary stats'data (number of classes, methods...)
 # 
-# This checker also defines the following reports:
-# * R0001: Total errors / warnings
-# * R0002: % errors / warnings by module
-# * R0003: Messages
-# * R0004: Global evaluation
 [MASTER]
 
+# Specify a configuration file.
+#rcfile=
+
 # Profiled execution.
 profile=no
 
 load-plugins=
 
 
+[MESSAGES CONTROL]
+
+# Enable only checker(s) with the given id(s). This option conflict 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
+#disable-checker=
+
+# Enable all messages in the listed categories.
+#enable-msg-cat=
+
+# Disable all messages in the listed categories.
+#disable-msg-cat=
+
+# Enable the message(s) with the given id(s).
+#enable-msg=
+
+# Disable the message(s) with the given id(s).
+disable-msg=C0323,W0142,C0301,C0103,C0111,E0213,C0302,C0203,W0703,R0201
+
+
 [REPORTS]
 
-# Tells wether to display a full report or only the messages
-reports=no
+# set the output format. Available formats are text, parseable, colorized and
+# html
+output-format=colorized
 
-# Use HTML as output format instead of text
-html=no
-
-# Use a parseable text output format, so your favorite text editor will be able
-# to jump to the line corresponding to a message.
-parseable=no
-
-# Colorizes text output using ansi escape codes
-color=yes
+# Include message's id in output
+include-ids=yes
 
 # Put messages in a separate file for each module / package specified on the
 # command line instead of printing them on stdout. Reports (if any) will be
 # written in a file name "pylint_global.[txt|html]".
 files-output=no
 
+# Tells wether to display a full report or only the messages
+reports=yes
+
 # Python expression which should return a note less than 10 (10 is the highest
 # note).You have access to the variables errors warning, statement which
 # respectivly contain the number of errors / warnings messages and the total
 # evaluation report (R0004).
 comment=no
 
-# Include message's id in output
-include-ids=no
+# Enable the report(s) with the given id(s).
+#enable-report=
 
-# Disable some irrelevant messages.
-disable-msg=W0142,W0613,R0201,W0704,C0111,W0703,W0603,I0011,W0122,C0321,W0631,C0203,W0511,W0221,R0401
+# Disable the report(s) with the given id(s).
+#disable-report=
 
 
 # checks for
 # 
 [VARIABLES]
 
-# Enable / disable this checker
-enable-variables=yes
-
 # Tells wether we should check for unused import in __init__ files.
 init-import=no
 
 # 
 [TYPECHECK]
 
-# Enable / disable this checker
-enable-typecheck=yes
-
 # Tells wether missing members accessed in mixin class should be ignored. A
 # mixin class is detected if its name ends with "mixin" (case insensitive).
 ignore-mixin-members=yes
 
 # When zope mode is activated, consider the acquired-members option to ignore
 # access to some undefined attributes.
-zope=yes
+zope=no
 
 # List of members which are usually get through zope's acquisition mecanism and
 # so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
-acquired-members=__subclasses__,__dict__
+acquired-members=REQUEST,acl_users,aq_parent
 
 
 # checks for :
 # * redefinition of function / method / class
 # * uses of the global statement
 # 
-# This checker also defines the following reports:
-# * R0101: Statistics by type
 [BASIC]
 
-# Enable / disable this checker
-enable-basic=yes
-
 # Required attributes for module, separated by a comma
 required-attributes=
-#__revision__
 
 # Regular expression which should only match functions or classes name which do
 # not require a docstring
 module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
 
 # Regular expression which should only match correct module level names
-const-rgx=(([A-Z_][A-Z1-9_]*)|[A-Za-z_][a-z1-9_]*|(__.*__))$
+const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$
 
 # Regular expression which should only match correct class names
-class-rgx=([A-Z_][a-zA-Z0-9]+|[a-z_]+|__metaclass__)$
+class-rgx=[A-Z_][a-zA-Z0-9]+$
 
 # Regular expression which should only match correct function names
-function-rgx=[a-z_][a-z0-9_]{1,30}$
+function-rgx=[a-z_][a-z0-9_]{2,30}$
 
 # Regular expression which should only match correct method names
-method-rgx=[a-z_][a-z0-9_]{1,30}$
+method-rgx=[a-z_][a-z0-9_]{2,30}$
 
 # Regular expression which should only match correct instance attribute names
-attr-rgx=[a-z_][a-z0-9_]{0,30}$
+attr-rgx=[a-z_][a-z0-9_]{2,30}$
 
 # Regular expression which should only match correct argument names
-argument-rgx=[a-z_][a-z0-9_]{0,30}$
+argument-rgx=[a-z_][a-z0-9_]{2,30}$
 
 # Regular expression which should only match correct variable names
-variable-rgx=[a-z_][a-z0-9_]{0,30}$
+variable-rgx=[a-z_][a-z0-9_]{2,30}$
 
 # Regular expression which should only match correct list comprehension /
 # generator expression variable names
 # 
 [DESIGN]
 
-# Enable / disable this checker
-enable-design=yes
-
 # Maximum number of arguments for function / method
 max-args=12
 
 max-locals=30
 
 # Maximum number of return / yield for function / method body
-max-returns=15
+max-returns=12
 
 # Maximum number of branch for function / method body
-max-branchs=50
+max-branchs=30
 
 # Maximum number of statements in function / method body
-max-statements=120
+max-statements=60
 
 # Maximum number of parents for a class (see R0901).
 max-parents=7
 
 # Maximum number of attributes for a class (see R0902).
-max-attributes=25
+max-attributes=20
 
 # Minimum number of public methods for a class (see R0903).
 min-public-methods=0
 
 # Maximum number of public methods for a class (see R0904).
-max-public-methods=30
-
-
-# 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
-# 
-[NEWSTYLE]
-
-# Enable / disable this checker
-enable-newstyle=yes
+max-public-methods=20
 
 
 # checks for
 # * cyclic imports
 # * uses of deprecated modules
 # 
-# This checker also defines the following reports:
-# * R0401: External dependencies
-# * R0402: Modules dependencies graph
 [IMPORTS]
 
-# Enable / disable this checker
-enable-imports=yes
-
 # Deprecated modules which should not be used, separated by a comma
 deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
 
 
 # checks for :
 # * methods without self as first argument
-# * overriden methods signature
+# * overridden methods signature
 # * access only to existant members via self
 # * attributes not defined in the __init__ method
 # * supported interfaces implementation
 # 
 [CLASSES]
 
-# Enable / disable this checker
-enable-classes=yes
-
 # List of interface methods to ignore, separated by a comma. This is used for
 # instance to not check methods defines in Zope's Interface base class.
 ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
 defining-attr-methods=__init__,__new__,setUp
 
 
-# checks for
-# * excepts without exception filter
-# * string exceptions
-# 
-[EXCEPTIONS]
-
-# Enable / disable this checker
-enable-exceptions=yes
-
-
-# does not check anything but gives some raw metrics :
-# * total number of lines
-# * total number of code lines
-# * total number of docstring lines
-# * total number of comments lines
-# * total number of empty lines
-# 
-# This checker also defines the following reports:
-# * R0701: Raw metrics
-[METRICS]
-
-# Enable / disable this checker
-enable-metrics=yes
-
-
 # checks for similarities and duplicated code. This computation may be
 # memory / CPU intensive, so you should disable it if you experiments some
 # problems.
 # 
-# This checker also defines the following reports:
-# * R0801: Duplication
 [SIMILARITIES]
 
-# Enable / disable this checker
-enable-similarities=yes
-
 # Minimum lines number of a similarity.
 min-similarity-lines=10
 
 
 
 # checks for:
-# * warning notes in the code
+# * warning notes in the code like FIXME, XXX
 # * PEP 263: source code with non ascii character but no encoding declaration
 # 
 [MISCELLANEOUS]
 
-# Enable / disable this checker
-enable-miscellaneous=yes
-
 # List of note tags to take in consideration, separated by a comma.
-notes=FIXME,XXX,TODO,HACK
+notes=FIXME,XXX,TODO
 
 
 # checks for :
 # 
 [FORMAT]
 
-# Enable / disable this checker
-enable-format=yes
-
 # Maximum number of characters on a single line.
 max-line-length=90
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.