src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/pycodestyle.py

branch
eric7
changeset 11150
73d80859079c
parent 11148
15e30f0c76a8
equal deleted inserted replaced
11149:fc45672fae42 11150:73d80859079c
287 have several windows side-by-side. The default wrapping on such 287 have several windows side-by-side. The default wrapping on such
288 devices looks ugly. Therefore, please limit all lines to a maximum 288 devices looks ugly. Therefore, please limit all lines to a maximum
289 of 79 characters. For flowing long blocks of text (docstrings or 289 of 79 characters. For flowing long blocks of text (docstrings or
290 comments), limiting the length to 72 characters is recommended. 290 comments), limiting the length to 72 characters is recommended.
291 291
292 Reports error E-501. 292 Reports error E501.
293 """ 293 """
294 line = physical_line.rstrip() 294 line = physical_line.rstrip()
295 length = len(line) 295 length = len(line)
296 if length > max_line_length and not noqa: 296 if length > max_line_length and not noqa:
297 # Special case: ignore long shebang lines. 297 # Special case: ignore long shebang lines.
304 if ((len(chunks) == 1 and multiline) or 304 if ((len(chunks) == 1 and multiline) or
305 (len(chunks) == 2 and chunks[0] == '#')) and \ 305 (len(chunks) == 2 and chunks[0] == '#')) and \
306 len(line) - len(chunks[-1]) < max_line_length - 7: 306 len(line) - len(chunks[-1]) < max_line_length - 7:
307 return 307 return
308 if length > max_line_length: 308 if length > max_line_length:
309 return (max_line_length, "E-501 line too long " 309 return (max_line_length, "E501 line too long "
310 "(%d > %d characters)" % (length, max_line_length), 310 "(%d > %d characters)" % (length, max_line_length),
311 length, max_line_length) 311 length, max_line_length)
312 312
313 313
314 ######################################################################## 314 ########################################################################

eric ide

mercurial