From cda86e6d746f0fc765b51c2d09bee4550599803e Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:35:48 +0300 Subject: [PATCH] style: modern typing in files.py --- src/darker/files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/darker/files.py b/src/darker/files.py index ed231213..068d12c4 100644 --- a/src/darker/files.py +++ b/src/darker/files.py @@ -3,7 +3,7 @@ from __future__ import annotations import inspect -from typing import TYPE_CHECKING, Collection, Optional, Set, Tuple +from typing import TYPE_CHECKING, Collection from black import ( DEFAULT_EXCLUDES, @@ -23,7 +23,7 @@ from darker.formatters.base_formatter import BaseFormatter -def find_pyproject_toml(path_search_start: Tuple[str, ...]) -> Optional[str]: +def find_pyproject_toml(path_search_start: tuple[str, ...]) -> str | None: """Find the absolute filepath to a pyproject.toml if it exists""" path_project_root = find_project_root(path_search_start) path_pyproject_toml = path_project_root / "pyproject.toml" @@ -47,7 +47,7 @@ def filter_python_files( paths: Collection[Path], # pylint: disable=unsubscriptable-object root: Path, formatter: BaseFormatter, -) -> Set[Path]: +) -> set[Path]: """Get Python files and explicitly listed files not excluded by Black's config. :param paths: Relative file/directory paths from CWD to Python sources