E50.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #: E501:4
  2. a = '12345678901234567890123456789012345678901234567890123456789012345678901234567890'
  3. #: E501:80
  4. a = '1234567890123456789012345678901234567890123456789012345678901234567890' or \
  5. 6
  6. #: E501+1:80
  7. a = 7 or \
  8. '1234567890123456789012345678901234567890123456789012345678901234567890' or \
  9. 6
  10. #: E501+1:80 E501+2:80
  11. a = 7 or \
  12. '1234567890123456789012345678901234567890123456789012345678901234567890' or \
  13. '1234567890123456789012345678901234567890123456789012345678901234567890' or \
  14. 6
  15. #: E501:78
  16. a = '1234567890123456789012345678901234567890123456789012345678901234567890' # \
  17. #: E502:78
  18. a = ('123456789012345678901234567890123456789012345678901234567890123456789' \
  19. '01234567890')
  20. #: E502+1:11
  21. a = ('AAA \
  22. BBB' \
  23. 'CCC')
  24. #: E502:38
  25. if (foo is None and bar is "e000" and \
  26. blah == 'yeah'):
  27. blah = 'yeahnah'
  28. #
  29. # Okay
  30. a = ('AAA'
  31. 'BBB')
  32. a = ('AAA \
  33. BBB'
  34. 'CCC')
  35. a = 'AAA' \
  36. 'BBB' \
  37. 'CCC'
  38. a = ('AAA\
  39. BBBBBBBBB\
  40. CCCCCCCCC\
  41. DDDDDDDDD')
  42. #
  43. # Okay
  44. if aaa:
  45. pass
  46. elif bbb or \
  47. ccc:
  48. pass
  49. ddd = \
  50. ccc
  51. ('\
  52. ' + ' \
  53. ')
  54. ('''
  55. ''' + ' \
  56. ')
  57. #: E501:67 E225:21 E225:22
  58. very_long_identifiers=and_terrible_whitespace_habits(are_no_excuse+for_long_lines)
  59. #
  60. # TODO Long multiline strings are not handled. E501?
  61. '''multiline string
  62. with a long long long long long long long long long long long long long long long long line
  63. '''
  64. #: E501
  65. '''same thing, but this time without a terminal newline in the string
  66. long long long long long long long long long long long long long long long long line'''
  67. #
  68. # issue 224 (unavoidable long lines in docstrings)
  69. # Okay
  70. """
  71. I'm some great documentation. Because I'm some great documentation, I'm
  72. going to give you a reference to some valuable information about some API
  73. that I'm calling:
  74. http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx
  75. """
  76. #: E501
  77. """
  78. longnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaces"""
  79. # Regression test for #622
  80. def foo():
  81. """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis pulvinar vitae
  82. """
  83. # Okay
  84. """
  85. This
  86. almost_empty_line
  87. """
  88. """
  89. This
  90. almost_empty_line
  91. """
  92. # A basic comment
  93. #: E501
  94. # with a long long long long long long long long long long long long long long long long line
  95. #
  96. # Okay
  97. # I'm some great comment. Because I'm so great, I'm going to give you a
  98. # reference to some valuable information about some API that I'm calling:
  99. #
  100. # http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx
  101. x = 3
  102. # longnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaceslongnospaces
  103. #
  104. # Okay
  105. # This
  106. # almost_empty_line
  107. #
  108. #: E501+1
  109. # This
  110. # almost_empty_line