diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2aa22b69..1e49afdc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,13 +20,13 @@ repos: - id: sort-simple-yaml - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.8.4' + rev: 'v0.9.3' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.0 hooks: - id: codespell additional_dependencies: ["tomli"] diff --git a/src/scmrepo/git/__init__.py b/src/scmrepo/git/__init__.py index 6d54b347..d6074532 100644 --- a/src/scmrepo/git/__init__.py +++ b/src/scmrepo/git/__init__.py @@ -258,7 +258,7 @@ def install_hook(self, name: str, script: str, interpreter: str = "sh") -> None: self.hooks_dir.mkdir(exist_ok=True) hook = self.hooks_dir / name - directive = f"#!{shutil.which(interpreter) or '/bin/sh' }" + directive = f"#!{shutil.which(interpreter) or '/bin/sh'}" hook.write_text(f"{directive}\n{script}\n", encoding="utf-8") hook.chmod(0o777) @@ -287,7 +287,7 @@ def close(self): def no_commits(self): return not bool(self.get_ref("HEAD")) - # Prefer re-using the most recently used backend when possible. When + # Prefer reusing the most recently used backend when possible. When # changing backends (due to unimplemented calls), we close the previous # backend to release any open git files/contexts that may cause conflicts # with the new backend. diff --git a/src/scmrepo/git/backend/gitpython.py b/src/scmrepo/git/backend/gitpython.py index f059b4dd..8b15fe68 100644 --- a/src/scmrepo/git/backend/gitpython.py +++ b/src/scmrepo/git/backend/gitpython.py @@ -184,7 +184,7 @@ def clone( # In fix_env, we delete LD_LIBRARY_PATH key if it was empty before # PyInstaller modified it. GitPython, in git.Repo.clone_from, uses # env to update its own internal state. When there is no key in - # env, this value is not updated and GitPython re-uses + # env, this value is not updated and GitPython reuses # LD_LIBRARY_PATH that has been set by PyInstaller. # See [1] for more info. # [1] https://github.com/gitpython-developers/GitPython/issues/924 diff --git a/src/scmrepo/git/backend/pygit2/__init__.py b/src/scmrepo/git/backend/pygit2/__init__.py index 61cb9364..e4a11b2d 100644 --- a/src/scmrepo/git/backend/pygit2/__init__.py +++ b/src/scmrepo/git/backend/pygit2/__init__.py @@ -720,7 +720,7 @@ def _default_status( for refname in remote_refs: if fnmatch.fnmatch(refname, lh): src = refname - dst = f"{rh_prefix}{refname[len(lh_prefix):]}" + dst = f"{rh_prefix}{refname[len(lh_prefix) :]}" result[dst] = cb.result.get( src, _default_status(src, dst, remote_refs) ) diff --git a/src/scmrepo/git/lfs/fetch.py b/src/scmrepo/git/lfs/fetch.py index cb3aef79..a69b58c0 100644 --- a/src/scmrepo/git/lfs/fetch.py +++ b/src/scmrepo/git/lfs/fetch.py @@ -122,7 +122,7 @@ def _collect_objects( and (result := _ROOT_PATH_PREFIX_REGEX.match(path := include[0])) ): root = result.group("prefix") - if path in {root, f'{root.rstrip("/")}/**'}: + if path in {root, f"{root.rstrip('/')}/**"}: include = [] else: root = "/"