Skip to content

Commit

Permalink
Merge pull request #264 from asottile/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
asottile authored Jul 30, 2024
2 parents bce0a37 + 07cef3a commit 0c27c2d
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
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
4 changes: 2 additions & 2 deletions git_code_debt/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_metrics(
) -> tuple[Metric, ...]:
def get_all_metrics(
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
for metric_parser_cls in metric_parsers:
metric_parser = metric_parser_cls()
yield from metric_parser.get_metrics_from_stat(
Expand Down Expand Up @@ -89,7 +89,7 @@ def _get_metrics_inner(

@contextlib.contextmanager
def mapper(jobs: int) -> Generator[
Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]], None, None,
Callable[[Callable[[T2], T], Iterable[T2]], Iterable[T]],
]:
if jobs == 1:
yield map
Expand Down
4 changes: 2 additions & 2 deletions git_code_debt/metrics/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_metrics_from_stat(
self,
commit: Commit,
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
"""Implement me to yield Metric objects from the input list of
FileStat objects.
Expand All @@ -50,7 +50,7 @@ def get_metrics_from_stat(
self,
_: Commit,
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
metric_value = 0

for file_diff_stat in file_diff_stats:
Expand Down
2 changes: 1 addition & 1 deletion git_code_debt/metrics/binary_file_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BinaryFileCount(DiffParserBase):
def get_metrics_from_stat(
self, _: Commit,
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
binary_delta = 0

for file_diff_stat in file_diff_stats:
Expand Down
2 changes: 1 addition & 1 deletion git_code_debt/metrics/curse.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_metrics_from_stat(
self,
_: Commit,
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
total_curses = 0
curses_by_file_type: dict[str, int] = collections.defaultdict(int)

Expand Down
2 changes: 1 addition & 1 deletion git_code_debt/metrics/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_metrics_from_stat(
self,
_: Commit,
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
total_lines = 0
lines_by_file_type: dict[str, int] = collections.defaultdict(int)

Expand Down
2 changes: 1 addition & 1 deletion git_code_debt/metrics/submodule_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_metrics_from_stat(
self,
_: Commit,
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
submodule_delta = 0

for file_diff_stat in file_diff_stats:
Expand Down
2 changes: 1 addition & 1 deletion git_code_debt/metrics/symlink_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_metrics_from_stat(
self,
_: Commit,
file_diff_stats: tuple[FileDiffStat, ...],
) -> Generator[Metric, None, None]:
) -> Generator[Metric]:
symlink_delta = 0

for file_diff_stat in file_diff_stats:
Expand Down
2 changes: 1 addition & 1 deletion git_code_debt/repo_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, git_repo: str) -> None:
self.tempdir: str | None = None

@contextlib.contextmanager
def repo_checked_out(self) -> Generator[None, None, None]:
def repo_checked_out(self) -> Generator[None]:
assert not self.tempdir
with tempfile.TemporaryDirectory(suffix='temp-repo') as self.tempdir:
try:
Expand Down
2 changes: 1 addition & 1 deletion git_code_debt/util/iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def chunk_iter(
iterable: Iterable[T],
n: int,
) -> Generator[tuple[T, ...], None, None]:
) -> Generator[tuple[T, ...]]:
"""Yields an iterator in chunks
For example you can do
Expand Down

0 comments on commit 0c27c2d

Please sign in to comment.