Update docs for configuration
[third_party/pep8] / testsuite / W19.py
1 #: W191
2 if False:
3         print  # indented with 1 tab
4 #:
5
6
7 #: W191
8 y = x == 2 \
9         or x == 3
10 #: E101 W191
11 if (
12         x == (
13             3
14         ) or
15         y == 4):
16         pass
17 #: E101 W191
18 if x == 2 \
19     or y > 1 \
20         or x == 3:
21         pass
22 #: E101 W191
23 if x == 2 \
24         or y > 1 \
25         or x == 3:
26         pass
27 #:
28
29 #: E101 W191
30 if (foo == bar and
31         baz == frop):
32         pass
33 #: E101 W191
34 if (
35     foo == bar and
36     baz == frop
37 ):
38         pass
39 #:
40
41 #: E101 E101 W191 W191
42 if start[1] > end_col and not (
43         over_indent == 4 and indent_next):
44         return(0, "E121 continuation line over-"
45                "indented for visual indent")
46 #:
47
48 #: E101 W191
49
50
51 def long_function_name(
52         var_one, var_two, var_three,
53         var_four):
54         print(var_one)
55 #: E101 W191
56 if ((row < 0 or self.moduleCount <= row or
57      col < 0 or self.moduleCount <= col)):
58         raise Exception("%s,%s - %s" % (row, col, self.moduleCount))
59 #: E101 E101 E101 E101 W191 W191 W191 W191 W191 W191
60 if bar:
61         return(
62             start, 'E121 lines starting with a '
63             'closing bracket should be indented '
64             "to match that of the opening "
65             "bracket's line"
66         )
67 #
68 #: E101 W191
69 # you want vertical alignment, so use a parens
70 if ((foo.bar("baz") and
71      foo.bar("frop")
72      )):
73         print "yes"
74 #: E101 W191
75 # also ok, but starting to look like LISP
76 if ((foo.bar("baz") and
77      foo.bar("frop"))):
78         print "yes"
79 #: E101 W191
80 if (a == 2 or
81     b == "abc def ghi"
82          "jkl mno"):
83         return True
84 #: E101 W191
85 if (a == 2 or
86     b == """abc def ghi
87 jkl mno"""):
88         return True
89 #: W191:2:1 W191:3:1 E101:3:2
90 if length > options.max_line_length:
91         return options.max_line_length, \
92             "E501 line too long (%d characters)" % length
93
94
95 #
96 #: E101 W191 W191
97 if os.path.exists(os.path.join(path, PEP8_BIN)):
98         cmd = ([os.path.join(path, PEP8_BIN)] +
99                self._pep8_options(targetfile))
100 #: W191
101 '''
102         multiline string with tab in it'''
103 #: E101 W191
104 '''multiline string
105         with tabs
106    and spaces
107 '''
108 #: Okay
109 '''sometimes, you just need to go nuts in a multiline string
110         and allow all sorts of crap
111   like mixed tabs and spaces
112       
113 or trailing whitespace  
114 or long long long long long long long long long long long long long long long long long lines
115 '''  # nopep8
116 #: Okay
117 '''this one
118         will get no warning
119 even though the noqa comment is not immediately after the string
120 ''' + foo  # noqa
121 #
122 #: E101 W191
123 if foo is None and bar is "frop" and \
124         blah == 'yeah':
125         blah = 'yeahnah'
126
127
128 #
129 #: W191 W191 W191
130 if True:
131         foo(
132                 1,
133                 2)
134 #: W191 W191 W191 W191 W191
135 def test_keys(self):
136         """areas.json - All regions are accounted for."""
137         expected = set([
138                 u'Norrbotten',
139                 u'V\xe4sterbotten',
140         ])
141 #: W191
142 x = [
143         'abc'
144 ]
145 #: