diff options
author | cpopa <devnull@localhost> | 2013-09-02 18:23:57 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2013-09-02 18:23:57 +0300 |
commit | 8aa1023bbf2cacebf3be0897aa866e176388dcb7 (patch) | |
tree | da9e901c588474c74cb70a4022a24756d6f972c5 | |
parent | 5754b5bb3f552fd5dd6c1a76b99368a853e2a543 (diff) | |
parent | 92bbafc7af894a0139064f812f153b3e5eeee4bb (diff) | |
download | pylint-8aa1023bbf2cacebf3be0897aa866e176388dcb7.tar.gz |
Merge with default.
-rw-r--r-- | .hgignore | 4 | ||||
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | checkers/format.py | 2 | ||||
-rw-r--r-- | doc/conf.py | 4 | ||||
-rw-r--r-- | test/input/func_noerror_defined_and_used_on_same_line.py | 3 | ||||
-rw-r--r-- | test/input/func_noerror_defined_and_used_on_same_line_py27.py | 5 | ||||
-rw-r--r-- | test/input/func_trailing_whitespace.py | 2 | ||||
-rw-r--r-- | test/input/func_unpack_exception_py_30.py (renamed from test/input/func_unpack_exception_py27.py) | 0 | ||||
-rw-r--r-- | test/messages/func_trailing_whitespace.txt | 1 | ||||
-rw-r--r-- | test/messages/func_unpack_exception_py_30.txt (renamed from test/messages/func_unpack_exception_py27.txt) | 0 | ||||
-rw-r--r-- | test/test_base.py | 8 | ||||
-rw-r--r-- | test/test_utils.py | 8 |
13 files changed, 30 insertions, 12 deletions
@@ -5,4 +5,6 @@ \.pyc$ \.pyo$ ^build$ -^doc/_build
\ No newline at end of file +^doc/_build +^dist/ +^pylint.egg-info/ @@ -1,7 +1,8 @@ ChangeLog for Pylint ==================== --- +2013-08-06 -- 1.0.0 + * Check for non-exception classes inside an except clause * Add check for the use of 'exec' function diff --git a/MANIFEST.in b/MANIFEST.in index 0d63cf1..32ec38e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,7 +6,7 @@ include bin/* include examples/*.py examples/pylintrc examples/pylintrc_camelcase include elisp/startup elisp/*.el include man/*.1 -recursive-include doc *.rst *.jpeg Makefile *.html +recursive-include doc *.rst *.jpeg Makefile *.html *.py recursive-include test *.py *.txt *.txt2 *.dot *.sh include test/input/similar* noext include test/input/noext diff --git a/checkers/format.py b/checkers/format.py index 69ed2e5..1cf0edc 100644 --- a/checkers/format.py +++ b/checkers/format.py @@ -355,7 +355,7 @@ class FormatChecker(BaseTokenChecker): self.add_message('C0304', line=i) else: stripped_line = line.rstrip() - if line != stripped_line + '\n': + if line[len(stripped_line):] not in ('\n', '\r\n'): self.add_message('C0303', line=i) # Don't count excess whitespace in the line length. line = stripped_line diff --git a/doc/conf.py b/doc/conf.py index 77d489e..3aaf613 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -48,9 +48,9 @@ copyright = u'2013, Logilab and contributors' # built documents. # # The short X.Y version. -version = '0.27' +version = '1.0.0' # The full version, including alpha/beta/rc tags. -release = '0.27' +release = '1.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/test/input/func_noerror_defined_and_used_on_same_line.py b/test/input/func_noerror_defined_and_used_on_same_line.py index a6a869f..71e67b9 100644 --- a/test/input/func_noerror_defined_and_used_on_same_line.py +++ b/test/input/func_noerror_defined_and_used_on_same_line.py @@ -28,6 +28,3 @@ FUNC3 = lambda (a, b) : a != b # test http://www.logilab.org/ticket/6954: with open('f') as f: print(f.read()) - -with open('f') as f, open(f.read()) as g: - print g.read() diff --git a/test/input/func_noerror_defined_and_used_on_same_line_py27.py b/test/input/func_noerror_defined_and_used_on_same_line_py27.py new file mode 100644 index 0000000..5a75722 --- /dev/null +++ b/test/input/func_noerror_defined_and_used_on_same_line_py27.py @@ -0,0 +1,5 @@ +#pylint: disable=C0111,C0321 +"""pylint complains about 'index' being used before definition""" + +with open('f') as f, open(f.read()) as g: + print g.read() diff --git a/test/input/func_trailing_whitespace.py b/test/input/func_trailing_whitespace.py index 54f6ae4..2d2786d 100644 --- a/test/input/func_trailing_whitespace.py +++ b/test/input/func_trailing_whitespace.py @@ -4,3 +4,5 @@ __revision__ = 0 print 'some trailing whitespace' print 'trailing whitespace does not count towards the line length limit' +print 'windows line ends are ok'
+print 'but trailing whitespace on win is not'
diff --git a/test/input/func_unpack_exception_py27.py b/test/input/func_unpack_exception_py_30.py index cf2e237..cf2e237 100644 --- a/test/input/func_unpack_exception_py27.py +++ b/test/input/func_unpack_exception_py_30.py diff --git a/test/messages/func_trailing_whitespace.txt b/test/messages/func_trailing_whitespace.txt index 51e4d52..bfac360 100644 --- a/test/messages/func_trailing_whitespace.txt +++ b/test/messages/func_trailing_whitespace.txt @@ -1,2 +1,3 @@ C: 5: Trailing whitespace C: 6: Trailing whitespace +C: 8: Trailing whitespace diff --git a/test/messages/func_unpack_exception_py27.txt b/test/messages/func_unpack_exception_py_30.txt index aaff92f..aaff92f 100644 --- a/test/messages/func_unpack_exception_py27.txt +++ b/test/messages/func_unpack_exception_py_30.txt diff --git a/test/test_base.py b/test/test_base.py index a5d0293..9bd3aa5 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -42,7 +42,7 @@ class DocstringTest(CheckerTestCase): pass""") with self.assertNoMessages(): self.checker.visit_function(func) - + def testClassNoDocstring(self): klass = test_utils.extract_node(""" class Klass(object): @@ -81,7 +81,7 @@ class NameCheckerTest(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_function(methods[0]) self.checker.visit_function(methods[2]) - with self.assertAddsMessages(Message('invalid-name', node=methods[1], + with self.assertAddsMessages(Message('invalid-name', node=methods[1], args=('attribute', 'bar'))): self.checker.visit_function(methods[1]) @@ -129,3 +129,7 @@ class NameCheckerTest(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_assname(assign.targets[0]) + +if __name__ == '__main__': + from logilab.common.testlib import unittest_main + unittest_main() diff --git a/test/test_utils.py b/test/test_utils.py index 282826b..fc35c3e 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -29,6 +29,7 @@ class PyLintASTWalkerTest(TestCase): class Checker(object): def __init__(self): self.called = set() + @check_messages('first-message') def visit_module(self, module): self.called.add('module') @@ -54,4 +55,9 @@ class PyLintASTWalkerTest(TestCase): walker.add_checker(checker) walker.walk(test_utils.build_module("x = func()")) self.assertEqual(set(['module', 'assname']), checker.called) - + + +if __name__ == '__main__': + from logilab.common.testlib import unittest_main + unittest_main() + |