pycodestyle.py 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. """Generated using ./bin/gen-pycodestyle-plugin."""
  2. # fmt: off
  3. from typing import Any
  4. from typing import Generator
  5. from typing import Tuple
  6. from pycodestyle import ambiguous_identifier as _ambiguous_identifier
  7. from pycodestyle import bare_except as _bare_except
  8. from pycodestyle import blank_lines as _blank_lines
  9. from pycodestyle import break_after_binary_operator as _break_after_binary_operator # noqa: E501
  10. from pycodestyle import break_before_binary_operator as _break_before_binary_operator # noqa: E501
  11. from pycodestyle import comparison_negative as _comparison_negative
  12. from pycodestyle import comparison_to_singleton as _comparison_to_singleton
  13. from pycodestyle import comparison_type as _comparison_type
  14. from pycodestyle import compound_statements as _compound_statements
  15. from pycodestyle import continued_indentation as _continued_indentation
  16. from pycodestyle import explicit_line_join as _explicit_line_join
  17. from pycodestyle import extraneous_whitespace as _extraneous_whitespace
  18. from pycodestyle import imports_on_separate_lines as _imports_on_separate_lines
  19. from pycodestyle import indentation as _indentation
  20. from pycodestyle import maximum_doc_length as _maximum_doc_length
  21. from pycodestyle import maximum_line_length as _maximum_line_length
  22. from pycodestyle import missing_whitespace as _missing_whitespace
  23. from pycodestyle import missing_whitespace_after_keyword as _missing_whitespace_after_keyword # noqa: E501
  24. from pycodestyle import missing_whitespace_around_operator as _missing_whitespace_around_operator # noqa: E501
  25. from pycodestyle import module_imports_on_top_of_file as _module_imports_on_top_of_file # noqa: E501
  26. from pycodestyle import python_3000_async_await_keywords as _python_3000_async_await_keywords # noqa: E501
  27. from pycodestyle import python_3000_backticks as _python_3000_backticks
  28. from pycodestyle import python_3000_has_key as _python_3000_has_key
  29. from pycodestyle import python_3000_invalid_escape_sequence as _python_3000_invalid_escape_sequence # noqa: E501
  30. from pycodestyle import python_3000_not_equal as _python_3000_not_equal
  31. from pycodestyle import python_3000_raise_comma as _python_3000_raise_comma
  32. from pycodestyle import tabs_obsolete as _tabs_obsolete
  33. from pycodestyle import tabs_or_spaces as _tabs_or_spaces
  34. from pycodestyle import trailing_blank_lines as _trailing_blank_lines
  35. from pycodestyle import trailing_whitespace as _trailing_whitespace
  36. from pycodestyle import whitespace_around_comma as _whitespace_around_comma
  37. from pycodestyle import whitespace_around_keywords as _whitespace_around_keywords # noqa: E501
  38. from pycodestyle import whitespace_around_named_parameter_equals as _whitespace_around_named_parameter_equals # noqa: E501
  39. from pycodestyle import whitespace_around_operator as _whitespace_around_operator # noqa: E501
  40. from pycodestyle import whitespace_before_comment as _whitespace_before_comment
  41. from pycodestyle import whitespace_before_parameters as _whitespace_before_parameters # noqa: E501
  42. def pycodestyle_logical(
  43. blank_before: Any,
  44. blank_lines: Any,
  45. checker_state: Any,
  46. hang_closing: Any,
  47. indent_char: Any,
  48. indent_level: Any,
  49. indent_size: Any,
  50. line_number: Any,
  51. lines: Any,
  52. logical_line: Any,
  53. max_doc_length: Any,
  54. noqa: Any,
  55. previous_indent_level: Any,
  56. previous_logical: Any,
  57. previous_unindented_logical_line: Any,
  58. tokens: Any,
  59. verbose: Any,
  60. ) -> Generator[Tuple[int, str], None, None]:
  61. """Run pycodestyle logical checks."""
  62. yield from _ambiguous_identifier(logical_line, tokens)
  63. yield from _bare_except(logical_line, noqa)
  64. yield from _blank_lines(logical_line, blank_lines, indent_level, line_number, blank_before, previous_logical, previous_unindented_logical_line, previous_indent_level, lines) # noqa: E501
  65. yield from _break_after_binary_operator(logical_line, tokens)
  66. yield from _break_before_binary_operator(logical_line, tokens)
  67. yield from _comparison_negative(logical_line)
  68. yield from _comparison_to_singleton(logical_line, noqa)
  69. yield from _comparison_type(logical_line, noqa)
  70. yield from _compound_statements(logical_line)
  71. yield from _continued_indentation(logical_line, tokens, indent_level, hang_closing, indent_char, indent_size, noqa, verbose) # noqa: E501
  72. yield from _explicit_line_join(logical_line, tokens)
  73. yield from _extraneous_whitespace(logical_line)
  74. yield from _imports_on_separate_lines(logical_line)
  75. yield from _indentation(logical_line, previous_logical, indent_char, indent_level, previous_indent_level, indent_size) # noqa: E501
  76. yield from _maximum_doc_length(logical_line, max_doc_length, noqa, tokens)
  77. yield from _missing_whitespace(logical_line)
  78. yield from _missing_whitespace_after_keyword(logical_line, tokens)
  79. yield from _missing_whitespace_around_operator(logical_line, tokens)
  80. yield from _module_imports_on_top_of_file(logical_line, indent_level, checker_state, noqa) # noqa: E501
  81. yield from _python_3000_async_await_keywords(logical_line, tokens)
  82. yield from _python_3000_backticks(logical_line)
  83. yield from _python_3000_has_key(logical_line, noqa)
  84. yield from _python_3000_invalid_escape_sequence(logical_line, tokens, noqa)
  85. yield from _python_3000_not_equal(logical_line)
  86. yield from _python_3000_raise_comma(logical_line)
  87. yield from _whitespace_around_comma(logical_line)
  88. yield from _whitespace_around_keywords(logical_line)
  89. yield from _whitespace_around_named_parameter_equals(logical_line, tokens)
  90. yield from _whitespace_around_operator(logical_line)
  91. yield from _whitespace_before_comment(logical_line, tokens)
  92. yield from _whitespace_before_parameters(logical_line, tokens)
  93. def pycodestyle_physical(
  94. indent_char: Any,
  95. line_number: Any,
  96. lines: Any,
  97. max_line_length: Any,
  98. multiline: Any,
  99. noqa: Any,
  100. physical_line: Any,
  101. total_lines: Any,
  102. ) -> Generator[Tuple[int, str], None, None]:
  103. """Run pycodestyle physical checks."""
  104. ret = _maximum_line_length(physical_line, max_line_length, multiline, line_number, noqa) # noqa: E501
  105. if ret is not None:
  106. yield ret
  107. ret = _tabs_obsolete(physical_line)
  108. if ret is not None:
  109. yield ret
  110. ret = _tabs_or_spaces(physical_line, indent_char)
  111. if ret is not None:
  112. yield ret
  113. ret = _trailing_blank_lines(physical_line, lines, line_number, total_lines)
  114. if ret is not None:
  115. yield ret
  116. ret = _trailing_whitespace(physical_line)
  117. if ret is not None:
  118. yield ret