diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-24 16:18:27 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-24 16:18:27 +0100 |
commit | 9e8fdd0e05be1c2a5eafdfb62bf62aa5b854f6fc (patch) | |
tree | 47b7bffd6e2120f6e0628c5250a1f216801bfc9a /testsuite | |
parent | 034b9f4fb082f72e1087a8a27dd0dd61486d1888 (diff) | |
download | pep8-9e8fdd0e05be1c2a5eafdfb62bf62aa5b854f6fc.tar.gz |
Fix a false E128 for indentation with tabs and add tests; issue #155
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/E90.py | 2 | ||||
-rw-r--r-- | testsuite/W19.py | 101 |
2 files changed, 102 insertions, 1 deletions
diff --git a/testsuite/E90.py b/testsuite/E90.py index 80bf04f..1371e31 100644 --- a/testsuite/E90.py +++ b/testsuite/E90.py @@ -8,7 +8,7 @@ while True: pass except: print 'Whoops' -#: E122 E128 E225 E251 E701 +#: E122 E225 E251 E701 # Do not crash if code is invalid if msg: diff --git a/testsuite/W19.py b/testsuite/W19.py index a629abe..c81f46f 100644 --- a/testsuite/W19.py +++ b/testsuite/W19.py @@ -1,3 +1,104 @@ #: W191 if False: print # indented with 1 tab +#: + + +#: E126 W191 +y = x == 2 \ + or x == 3 +#: E101 W191 +if ( + x == ( + 3 + ) or + y == 4): + pass +#: E101 W191 +if x == 2 \ + or y > 1 \ + or x == 3: + pass +#: E101 W191 +if x == 2 \ + or y > 1 \ + or x == 3: + pass +#: + +#: E101 W191 +if (foo == bar and + baz == frop): + pass +#: E101 W191 +if ( + foo == bar and + baz == frop +): + pass +#: + +#: E101 W191 +if start[1] > end_col and not ( + over_indent == 4 and indent_next): + return(0, "E121 continuation line over-" + "indented for visual indent") +#: + +#: E101 W191 + + +def long_function_name( + var_one, var_two, var_three, + var_four): + print(var_one) +#: E101 W191 +if ((row < 0 or self.moduleCount <= row or + col < 0 or self.moduleCount <= col)): + raise Exception("%s,%s - %s" % (row, col, self.moduleCount)) +#: E101 W191 +if bar: + return( + start, 'E121 lines starting with a ' + 'closing bracket should be indented ' + "to match that of the opening " + "bracket's line" + ) +# +#: E101 W191 +# you want vertical alignment, so use a parens +if ((foo.bar("baz") and + foo.bar("frop") + )): + print "yes" +#: E101 W191 +# also ok, but starting to look like LISP +if ((foo.bar("baz") and + foo.bar("frop"))): + print "yes" +#: E101 W191 +if (a == 2 or + b == "abc def ghi" + "jkl mno"): + return True +#: E101 W191 +if (a == 2 or + b == """abc def ghi +jkl mno"""): + return True +#: E101 W191 +if length > options.max_line_length: + return options.max_line_length, \ + "E501 line too long (%d characters)" % length + + +# +#: E101 W191 +if os.path.exists(os.path.join(path, PEP8_BIN)): + cmd = ([os.path.join(path, PEP8_BIN)] + + self._pep8_options(targetfile)) +#: E101 W191 +if foo is None and bar is "frop" and \ + blah == 'yeah': + blah = 'yeahnah' +#: |