Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #341

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion all_repos/autofix/pre_commit_autoupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion all_repos/autofix_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion all_repos/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions all_repos/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion all_repos/sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading