Skip to content

Commit

Permalink
Avoid future import in tools (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret committed Jul 20, 2024
1 parent c9b56aa commit a5c8f1e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions config/commands/_split_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 14,13 @@
<n_lines> is the number of lines added in the edit
"""

# ruff: noqa: UP007 UP006 UP035

from __future__ import annotations

import sys
from dataclasses import dataclass
from typing import List, Optional, Tuple


@dataclass
Expand All @@ -37,8 40,8 @@ def from_line(cls, line: str):


def _update_previous_errors(
previous_errors: list[Flake8Error], replacement_window: tuple[int, int], replacement_n_lines: int
) -> list[Flake8Error]:
previous_errors: List[Flake8Error], replacement_window: tuple[int, int], replacement_n_lines: int
) -> List[Flake8Error]:
"""Update the line numbers of the previous errors to what they would be after the edit window.
This is a helper function for `_filter_previous_errors`.
Expand Down Expand Up @@ -74,8 77,8 @@ def format_flake8_output(
show_line_numbers: bool = False,
*,
previous_errors_string: str = "",
replacement_window: tuple[int, int] | None = None,
replacement_n_lines: int | None = None,
replacement_window: Optional[Tuple[int, int]] = None,
replacement_n_lines: Optional[int] = None,
) -> str:
"""Filter flake8 output for previous errors and print it for a given file.
Expand Down

0 comments on commit a5c8f1e

Please sign in to comment.