pycodestyle.py 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. """Generated using ./bin/gen-pycodestyle-plugin."""
  2. # fmt: off
  3. from __future__ import annotations
  4. from typing import Any
  5. from typing import Generator
  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 module_imports_on_top_of_file as _module_imports_on_top_of_file # noqa: E501
  25. from pycodestyle import python_3000_invalid_escape_sequence as _python_3000_invalid_escape_sequence # noqa: E501
  26. from pycodestyle import tabs_obsolete as _tabs_obsolete
  27. from pycodestyle import tabs_or_spaces as _tabs_or_spaces
  28. from pycodestyle import trailing_blank_lines as _trailing_blank_lines
  29. from pycodestyle import trailing_whitespace as _trailing_whitespace
  30. from pycodestyle import whitespace_around_comma as _whitespace_around_comma
  31. from pycodestyle import whitespace_around_keywords as _whitespace_around_keywords # noqa: E501
  32. from pycodestyle import whitespace_around_named_parameter_equals as _whitespace_around_named_parameter_equals # noqa: E501
  33. from pycodestyle import whitespace_around_operator as _whitespace_around_operator # noqa: E501
  34. from pycodestyle import whitespace_before_comment as _whitespace_before_comment
  35. from pycodestyle import whitespace_before_parameters as _whitespace_before_parameters # noqa: E501
  36. def pycodestyle_logical(
  37. blank_before: Any,
  38. blank_lines: Any,
  39. checker_state: Any,
  40. hang_closing: Any,
  41. indent_char: Any,
  42. indent_level: Any,
  43. indent_size: Any,
  44. line_number: Any,
  45. lines: Any,
  46. logical_line: Any,
  47. max_doc_length: Any,
  48. noqa: Any,
  49. previous_indent_level: Any,
  50. previous_logical: Any,
  51. previous_unindented_logical_line: Any,
  52. tokens: Any,
  53. verbose: Any,
  54. ) -> Generator[tuple[int, str], None, None]:
  55. """Run pycodestyle logical checks."""
  56. yield from _ambiguous_identifier(logical_line, tokens)
  57. yield from _bare_except(logical_line, noqa)
  58. 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
  59. yield from _break_after_binary_operator(logical_line, tokens)
  60. yield from _break_before_binary_operator(logical_line, tokens)
  61. yield from _comparison_negative(logical_line)
  62. yield from _comparison_to_singleton(logical_line, noqa)
  63. yield from _comparison_type(logical_line, noqa)
  64. yield from _compound_statements(logical_line)
  65. yield from _continued_indentation(logical_line, tokens, indent_level, hang_closing, indent_char, indent_size, noqa, verbose) # noqa: E501
  66. yield from _explicit_line_join(logical_line, tokens)
  67. yield from _extraneous_whitespace(logical_line)
  68. yield from _imports_on_separate_lines(logical_line)
  69. yield from _indentation(logical_line, previous_logical, indent_char, indent_level, previous_indent_level, indent_size) # noqa: E501
  70. yield from _maximum_doc_length(logical_line, max_doc_length, noqa, tokens)
  71. yield from _missing_whitespace(logical_line, tokens)
  72. yield from _missing_whitespace_after_keyword(logical_line, tokens)
  73. yield from _module_imports_on_top_of_file(logical_line, indent_level, checker_state, noqa) # noqa: E501
  74. yield from _python_3000_invalid_escape_sequence(logical_line, tokens, noqa)
  75. yield from _whitespace_around_comma(logical_line)
  76. yield from _whitespace_around_keywords(logical_line)
  77. yield from _whitespace_around_named_parameter_equals(logical_line, tokens)
  78. yield from _whitespace_around_operator(logical_line)
  79. yield from _whitespace_before_comment(logical_line, tokens)
  80. yield from _whitespace_before_parameters(logical_line, tokens)
  81. def pycodestyle_physical(
  82. indent_char: Any,
  83. line_number: Any,
  84. lines: Any,
  85. max_line_length: Any,
  86. multiline: Any,
  87. noqa: Any,
  88. physical_line: Any,
  89. total_lines: Any,
  90. ) -> Generator[tuple[int, str], None, None]:
  91. """Run pycodestyle physical checks."""
  92. ret = _maximum_line_length(physical_line, max_line_length, multiline, line_number, noqa) # noqa: E501
  93. if ret is not None:
  94. yield ret
  95. ret = _tabs_obsolete(physical_line)
  96. if ret is not None:
  97. yield ret
  98. ret = _tabs_or_spaces(physical_line, indent_char)
  99. if ret is not None:
  100. yield ret
  101. ret = _trailing_blank_lines(physical_line, lines, line_number, total_lines)
  102. if ret is not None:
  103. yield ret
  104. ret = _trailing_whitespace(physical_line)
  105. if ret is not None:
  106. yield ret