diff options
-rw-r--r-- | pylint/checkers/python3.py | 2 | ||||
-rw-r--r-- | pylint/checkers/variables.py | 4 | ||||
-rw-r--r-- | pylint/lint.py | 36 | ||||
-rw-r--r-- | pylint/reporters/__init__.py | 3 | ||||
-rw-r--r-- | pylint/utils.py | 2 | ||||
-rw-r--r-- | pylintrc | 2 |
6 files changed, 25 insertions, 24 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py index 837cbef..ccffce7 100644 --- a/pylint/checkers/python3.py +++ b/pylint/checkers/python3.py @@ -448,7 +448,7 @@ class Python3Checker(checkers.BaseChecker): args = node.args elif (isinstance(node.func, astroid.Name) - and node.func.name == 'sorted'): + and node.func.name == 'sorted'): inferred = utils.safe_infer(node.func) if not inferred: return diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index d626013..2582073 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -43,7 +43,7 @@ def _is_from_future_import(stmt, name): """Check if the name is a future import from another module.""" try: module = stmt.do_import_module(stmt.modname) - except InferenceError: + except astroid.InferenceError: return for local_node in module.locals.get(name, []): @@ -425,7 +425,7 @@ builtins. Remember that you should avoid to define new builtins when possible.' msg = "%s imported as %s" % (imported_name, as_name) self.add_message('unused-import', args=msg, node=stmt) elif (isinstance(stmt, astroid.From) - and stmt.modname != '__future__'): + and stmt.modname != '__future__'): if SPECIAL_OBJ.search(imported_name): # Filter special objects (__doc__, __all__) etc., diff --git a/pylint/lint.py b/pylint/lint.py index 0df8475..aeef0fa 100644 --- a/pylint/lint.py +++ b/pylint/lint.py @@ -402,24 +402,24 @@ class PyLinter(configuration.OptionsManagerMixIn, ' may run arbitrary code.')}), ('extension-pkg-whitelist', - {'type': 'csv', 'metavar': '<pkg[,pkg]>', 'default': [], - 'help': ('A comma-separated list of package or module names' - ' from where C extensions may be loaded. Extensions are' - ' loading into the active Python interpreter and may run' - ' arbitrary code')} - ), + {'type': 'csv', 'metavar': '<pkg[,pkg]>', 'default': [], + 'help': ('A comma-separated list of package or module names' + ' from where C extensions may be loaded. Extensions are' + ' loading into the active Python interpreter and may run' + ' arbitrary code')} + ), ('optimize-ast', - {'type': 'yn', 'metavar': '<yn>', 'default': False, - 'help': ('Allow optimization of some AST trees. This will ' - 'activate a peephole AST optimizer, which will ' - 'apply various small optimizations. For instance, ' - 'it can be used to obtain the result of joining ' - 'multiple strings with the addition operator. ' - 'Joining a lot of strings can lead to a maximum ' - 'recursion error in Pylint and this flag can prevent ' - 'that. It has one side effect, the resulting AST ' - 'will be different than the one from reality.')} + {'type': 'yn', 'metavar': '<yn>', 'default': False, + 'help': ('Allow optimization of some AST trees. This will ' + 'activate a peephole AST optimizer, which will ' + 'apply various small optimizations. For instance, ' + 'it can be used to obtain the result of joining ' + 'multiple strings with the addition operator. ' + 'Joining a lot of strings can lead to a maximum ' + 'recursion error in Pylint and this flag can prevent ' + 'that. It has one side effect, the resulting AST ' + 'will be different than the one from reality.')} ), ) @@ -528,8 +528,8 @@ class PyLinter(configuration.OptionsManagerMixIn, meth = self._options_methods[optname] except KeyError: meth = self._bw_options_methods[optname] - warnings.warn('%s is deprecated, replace it by %s' % ( - optname, optname.split('-')[0]), + warnings.warn('%s is deprecated, replace it by %s' % (optname, + optname.split('-')[0]), DeprecationWarning) value = optik_ext.check_csv(None, optname, value) if isinstance(value, (list, tuple)): diff --git a/pylint/reporters/__init__.py b/pylint/reporters/__init__.py index ea3281f..db96cf6 100644 --- a/pylint/reporters/__init__.py +++ b/pylint/reporters/__init__.py @@ -17,6 +17,7 @@ from __future__ import print_function import sys import locale import os +import six from pylint import utils @@ -78,7 +79,7 @@ class BaseReporter(object): return def encode(string): - if not isinstance(string, unicode): + if not isinstance(string, six.text_type): return string encoding = (getattr(self.out, 'encoding', None) or locale.getdefaultlocale()[1] or diff --git a/pylint/utils.py b/pylint/utils.py index f220793..d1f4974 100644 --- a/pylint/utils.py +++ b/pylint/utils.py @@ -133,7 +133,7 @@ def category_id(cid): def _decoding_readline(stream, module): return lambda: stream.readline().decode(module.file_encoding, - 'replace') + 'replace') def tokenize_module(module): @@ -60,7 +60,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=C0103,C0111,C0302,C0330,C0401,C0402,C0403,C1001,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0106,E0107,E0108,E0109,E0110,E0111,E0202,E0203,E0211,E0213,E0221,E0222,E0235,E0236,E0237,E0238,E0239,E0601,E0602,E0603,E0604,E0611,E0701,E0702,E0710,E0711,E0712,E1001,E1002,E1003,E1004,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1126,E1127,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1601,E1602,E1603,E1604,E1605,E1606,E1607,E1608,F0001,F0002,F0003,F0010,F0202,F0220,F0401,I0001,I0010,I0011,I0012,I0013,I0020,I0021,I0022,R0201,R0401,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0923,W0101,W0102,W0104,W0105,W0106,W0107,W0108,W0109,W0110,W0120,W0122,W0123,W0141,W0142,W0150,W0199,W0201,W0211,W0212,W0221,W0222,W0223,W0231,W0232,W0233,W0234,W0301,W0311,W0312,W0332,W0401,W0402,W0403,W0404,W0406,W0410,W0511,W0512,W0601,W0602,W0603,W0604,W0611,W0612,W0613,W0614,W0621,W0622,W0623,W0631,W0632,W0633,W0640,W0702,W0703,W0704,W0710,W0711,W1001,W1111,W1201,W1202,W1300,W1301,W1302,W1303,W1304,W1305,W1306,W1307,W1401,W1402,W1501,W1502,W1503,W1504,W1601,W1602,W1603,W1604,W1605,W1606,W1607,W1608,W1609,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1618,W1619,W1620,W1621,W1622,W1623,W1624,W1625,W1626,W1627,W1628,W1629,W1630,W1632,W1633,W1634,W1635,W1636,W1637,W1638,W1639 +disable=C0103,C0111,C0302,C1001,E0239,E1101,R0201,R0401,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0923,W0199,W0201,W0211,W0212,W0221,W0222,W0223,W0231,W0232,W0233,W0234,W0301,W0311,W0312,W0332,W0401,W0402,W0403,W0404,W0406,W0410,W0511,W0512,W0601,W0602,W0603,W0604,W0611,W0612,W0613,W0614,W0621,W0622,W0623,W0631,W0632,W0633,W0640,W0702,W0703,W0704,W0710,W0711,W1001,W1111,W1201,W1202,W1300,W1301,W1302,W1303,W1304,W1305,W1306,W1307,W1401,W1402,W1501,W1502,W1503,W1504,W1601,W1602,W1603,W1604,W1605W1606,W1607,W1608,W1609,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1618,W1619,W1620,W1621,W1622,W1623,W1624,W1625,W1626,W1627,W1628,W1629,W1630,W1632,W1633,W1634,W1635,W1636,W1637,W1638,W1639 [REPORTS] |