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 #399

Merged
merged 3 commits into from
Jan 31, 2025
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions src/scmrepo/git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/scmrepo/git/backend/gitpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/scmrepo/git/backend/pygit2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
2 changes: 1 addition & 1 deletion src/scmrepo/git/lfs/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "/"
Expand Down