From 903fdc0a84a46d4cebdab34dfe7a84006beb0573 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:58:01 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v3.4.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v3.4.0...v5.0.0) - [github.com/asottile/pyupgrade: v2.12.0 → v3.19.1](https://github.com/asottile/pyupgrade/compare/v2.12.0...v3.19.1) - [github.com/Lucas-C/pre-commit-hooks: v1.5.1 → v1.5.5](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.5.1...v1.5.5) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62c1c56..3a5213e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: reformat-pyproject - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-ast @@ -62,7 +62,7 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/asottile/pyupgrade - rev: v2.12.0 + rev: v3.19.1 hooks: - id: pyupgrade args: @@ -70,7 +70,7 @@ repos: - --keep-runtime-typing - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.1 + rev: v1.5.5 hooks: - id: remove-crlf - id: forbid-crlf From 01c9a5f096c0723058141892e10cd950d070f1c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:01:10 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- southwark/__init__.py | 4 ++-- southwark/config.py | 4 ++-- southwark/log.py | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/southwark/__init__.py b/southwark/__init__.py index d410ac9..58bfb9e 100644 --- a/southwark/__init__.py +++ b/southwark/__init__.py @@ -417,13 +417,13 @@ def clone( target_config = r.get_config() target_config.set(("remote", origin), "url", source.encode("UTF-8")) - target_config.set(("remote", origin), "fetch", f"+refs/heads/*:refs/remotes/{origin}/*".encode("UTF-8")) + target_config.set(("remote", origin), "fetch", f"+refs/heads/*:refs/remotes/{origin}/*".encode()) target_config.write_to_path() fetch_result = fetch( r, origin, errstream=errstream, - message=f"clone: from {source}".encode("UTF-8"), + message=f"clone: from {source}".encode(), depth=depth, **kwargs, ) diff --git a/southwark/config.py b/southwark/config.py index d020553..65617f0 100644 --- a/southwark/config.py +++ b/southwark/config.py @@ -62,7 +62,7 @@ def set_remote_ssh(config: ConfigFile, domain: str, username: str, repo: str, na :param name: The name of the remote to set. """ - config.set(("remote", name), "url", f"git@{domain}:{username}/{repo}.git".encode("UTF-8")) + config.set(("remote", name), "url", f"git@{domain}:{username}/{repo}.git".encode()) def set_remote_http(config: ConfigFile, domain: str, username: str, repo: str, name: str = "origin") -> None: @@ -76,7 +76,7 @@ def set_remote_http(config: ConfigFile, domain: str, username: str, repo: str, n :param name: The name of the remote to set. """ - config.set(("remote", name), "url", f"https://{domain}/{username}/{repo}.git".encode("UTF-8")) + config.set(("remote", name), "url", f"https://{domain}/{username}/{repo}.git".encode()) set_remote_html = set_remote_http diff --git a/southwark/log.py b/southwark/log.py index 9495b83..223218b 100644 --- a/southwark/log.py +++ b/southwark/log.py @@ -74,8 +74,7 @@ def __init__(self, repo: Union[dulwich.repo.Repo, PathLike] = '.'): #: Mapping of git refs to commit SHAs. self.refs: Dict[str, str] = { k.decode("UTF-8"): v.decode("UTF-8") - for k, - v in self.repo.get_refs().items() + for k, v in self.repo.get_refs().items() if not k.startswith(b"refs/tags/") }