Take over pull request #593 to ignore variables starting with "def" or "class" on code E305.

Mon, 07 Nov 2016 22:26:01 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Mon, 07 Nov 2016 22:26:01 +0100
changeset 5303
83ab5275f255
parent 5299
1ecd89554ddb
child 5304
969a03f0d968

Take over pull request #593 to ignore variables starting with "def" or "class" on code E305.

Plugins/CheckerPlugins/CodeStyleChecker/pycodestyle.py file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/CodeStyleChecker/pycodestyle.py	Mon Nov 07 19:22:23 2016 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/pycodestyle.py	Mon Nov 07 22:26:01 2016 +0100
@@ -268,6 +268,8 @@
     Okay: def a():\n    pass\n\n\ndef b():\n    pass
     Okay: def a():\n    pass\n\n\nasync def b():\n    pass
     Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
+    Okay: default = 1\nfoo = 1
+    Okay: classify = 1\nfoo = 1
 
     E301: class Foo:\n    b = 0\n    def bar():\n        pass
     E302: def a():\n    pass\n\ndef b(n):\n    pass
@@ -305,7 +307,7 @@
         elif blank_before != 2:
             yield 0, "E302 expected 2 blank lines, found %d", blank_before
     elif (logical_line and not indent_level and blank_before != 2 and
-          previous_unindented_logical_line.startswith(('def', 'class'))):
+          previous_unindented_logical_line.startswith(('def ', 'class '))):
         yield 0, "E305 expected 2 blank lines after " \
             "class or function definition, found %d", blank_before
 

eric ide

mercurial