diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f869f5e..3a4d24f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [--py38-plus] diff --git a/all_repos/autofix/pre_commit_autoupdate.py b/all_repos/autofix/pre_commit_autoupdate.py index a4d013e..605c6f0 100644 --- a/all_repos/autofix/pre_commit_autoupdate.py +++ b/all_repos/autofix/pre_commit_autoupdate.py @@ -15,7 +15,7 @@ @contextlib.contextmanager -def tmp_pre_commit_home() -> Generator[None, None, None]: +def tmp_pre_commit_home() -> Generator[None]: """During lots of autoupdates, many repositories will be cloned into the pre-commit directory. This prevents leaving many MB/GB of repositories behind due to this autofixer. This context creates a temporary directory diff --git a/all_repos/autofix_lib.py b/all_repos/autofix_lib.py index d0b08bd..fea043c 100644 --- a/all_repos/autofix_lib.py +++ b/all_repos/autofix_lib.py @@ -152,7 +152,7 @@ def target_branch() -> str: @contextlib.contextmanager -def repo_context(repo: str, *, use_color: bool) -> Generator[None, None, None]: +def repo_context(repo: str, *, use_color: bool) -> Generator[None]: print(color.fmt(f'***{repo}', color.TURQUOISE_H, use_color=use_color)) try: remote = git.remote(repo) diff --git a/all_repos/clone.py b/all_repos/clone.py index 47b3771..52f41a3 100644 --- a/all_repos/clone.py +++ b/all_repos/clone.py @@ -17,7 +17,7 @@ def _get_current_state_helper( path: str, -) -> Generator[tuple[str, str], None, None]: +) -> Generator[tuple[str, str]]: if not os.path.exists(path): return diff --git a/all_repos/mapper.py b/all_repos/mapper.py index f1d90b4..6829be2 100644 --- a/all_repos/mapper.py +++ b/all_repos/mapper.py @@ -19,14 +19,14 @@ def exhaust(gen: Iterable[T]) -> None: @contextlib.contextmanager def _in_process() -> Generator[ - Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]], None, None, + Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]], ]: yield map @contextlib.contextmanager def _threads(jobs: int) -> Generator[ - Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]], None, None, + Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]], ]: with concurrent.futures.ThreadPoolExecutor(jobs) as ex: yield ex.map @@ -43,7 +43,7 @@ def thread_mapper(jobs: int) -> ContextManager[ @contextlib.contextmanager def _processes(jobs: int) -> Generator[ - Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]], None, None, + Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]], ]: with concurrent.futures.ProcessPoolExecutor(jobs) as ex: yield ex.map diff --git a/all_repos/sed.py b/all_repos/sed.py index 91ab5e0..f665be2 100644 --- a/all_repos/sed.py +++ b/all_repos/sed.py @@ -19,7 +19,7 @@ def find_repos( config: Config, *, ls_files_cmd: Sequence[str], -) -> Generator[str, None, None]: +) -> Generator[str]: for repo in config.get_cloned_repos(): repo_dir = os.path.join(config.output_dir, repo) if subprocess.run(