summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2013-03-29 18:42:21 +0100
committerSylvain Thénault <sylvain.thenault@logilab.fr>2013-03-29 18:42:21 +0100
commitc20fb5205948021e71c770544af4fac940788013 (patch)
tree42dd86108261c723348ae365c665e51e4e28ff27
parent1c19e05887bb6abb26dd54cffa8229226a4ca36c (diff)
downloadpylint-git-c20fb5205948021e71c770544af4fac940788013.tar.gz
a few pylint fixes and copyright cleanups
-rw-r--r--checkers/base.py2
-rw-r--r--lint.py8
-rw-r--r--reporters/text.py4
-rw-r--r--testutils.py8
-rw-r--r--utils.py6
5 files changed, 12 insertions, 16 deletions
diff --git a/checkers/base.py b/checkers/base.py
index 3b687d65e..e8dca11cb 100644
--- a/checkers/base.py
+++ b/checkers/base.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE).
+# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# Copyright (c) 2009-2010 Arista Networks, Inc.
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
# This program is free software; you can redistribute it and/or modify it under
diff --git a/lint.py b/lint.py
index 180569206..17e7f4176 100644
--- a/lint.py
+++ b/lint.py
@@ -1,5 +1,4 @@
-# Copyright (c) 2003-2010 Sylvain Thenault (thenault@gmail.com).
-# Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE).
+# Copyright (c) 2003-2013 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 it under
@@ -630,7 +629,6 @@ This is used by the global evaluation report (RP0004).'}),
# messages which are only detected in the .close step)
if modname:
self._module_msgs_state = {}
- self._module_msg_cats_state = {}
self._raw_module_msgs_state = {}
self._ignored_msgs = {}
@@ -862,8 +860,8 @@ group are mutually exclusive.'),
'rcfile': (self.cb_set_rcfile, True),
'load-plugins': (self.cb_add_plugins, True),
})
- except ArgumentPreprocessingError, e:
- print >> sys.stderr, 'Argument %s expects a value.' % (e.args[0],)
+ except ArgumentPreprocessingError, ex:
+ print >> sys.stderr, 'Argument %s expects a value.' % (ex.args[0],)
sys.exit(32)
self.linter = linter = self.LinterClass((
diff --git a/reporters/text.py b/reporters/text.py
index 1dde0de30..d5b4a9bf1 100644
--- a/reporters/text.py
+++ b/reporters/text.py
@@ -1,5 +1,4 @@
-# Copyright (c) 2003-2007 Sylvain Thenault (thenault@gmail.com).
-# Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE).
+# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
@@ -23,7 +22,6 @@
"""
import os
-import sys
from logilab.common.ureports import TextWriter
from logilab.common.textutils import colorize_ansi
diff --git a/testutils.py b/testutils.py
index bd9d4cb03..40ee11637 100644
--- a/testutils.py
+++ b/testutils.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE).
+# Copyright (c) 2003-2013 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 it under
@@ -92,10 +92,10 @@ class TestReporter(BaseReporter):
def add_message(self, msg_id, location, msg):
"""manage message of different type and in the context of path """
- fpath, module, object, line, _ = location
+ fpath, module, obj, line, _ = location
self.message_ids[msg_id] = 1
if object:
- object = ':%s' % object
+ object = ':%s' % obj
sigle = msg_id[0]
self.messages.append('%s:%3s%s: %s' % (sigle, line, object, msg))
@@ -127,7 +127,7 @@ else:
def ulines(string):
return string
-INFO_TEST_RGX = re.compile('^func_i\d\d\d\d$')
+INFO_TEST_RGX = re.compile(r'^func_i\d\d\d\d$')
def exception_str(self, ex):
"""function used to replace default __str__ method of exception instances"""
diff --git a/utils.py b/utils.py
index eae621d09..c75d3bb6e 100644
--- a/utils.py
+++ b/utils.py
@@ -1,5 +1,4 @@
-# Copyright (c) 2003-2010 Sylvain Thenault (thenault@gmail.com).
-# Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE).
+# Copyright (c) 2003-2013 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 it under
@@ -133,6 +132,7 @@ class MessagesHandlerMixIn:
self._msgs_by_category = {}
self.msg_status = 0
self._ignored_msgs = {}
+ self._suppression_mapping = {}
def register_messages(self, checker):
"""register a dictionary of messages
@@ -156,7 +156,7 @@ class MessagesHandlerMixIn:
assert msgsymbol not in self._messages_by_symbol, \
'Message symbol %r is already defined' % msgsymbol
if len(msg_tuple) > 3 and 'scope' in msg_tuple[3]:
- scope = msg_tuple[3]['scope']
+ scope = msg_tuple[3]['scope']
else:
# messages should have a symbol, but for backward compatibility
# they may not.