From e8cc1e46fe963f4104ce66a9229d6792a09b4d8e Mon Sep 17 00:00:00 2001 From: sobolevn Date: Wed, 10 Jul 2024 12:41:40 +0300 Subject: [PATCH] Add `_write` method to `flake8.formatting.BaseFormatter` (#12312) It is very useful for real-life custom formatters. Example: https://github.com/wemake-services/wemake-python-styleguide/blob/470d81174684eb9a175603aec02f0ac6589b8acd/wemake_python_styleguide/formatter.py#L92-L96 Definition: https://github.com/PyCQA/flake8/blob/65a38c42a7f1a05ff8d99b313160754fc9b7a0d8/src/flake8/formatting/base.py#L173-L178 --- stubs/flake8/flake8/formatting/base.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/flake8/flake8/formatting/base.pyi b/stubs/flake8/flake8/formatting/base.pyi index 2ed0775ba..8401cdf00 100644 --- a/stubs/flake8/flake8/formatting/base.pyi +++ b/stubs/flake8/flake8/formatting/base.pyi @@ -21,4 +21,5 @@ class BaseFormatter: def show_benchmarks(self, benchmarks: list[tuple[str, float]]) -> None: ... def show_source(self, error: Violation) -> str | None: ... def write(self, line: str | None, source: str | None) -> None: ... + def _write(self, output: str) -> None: ... def stop(self) -> None: ...