Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#364)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.4.8](astral-sh/ruff-pre-commit@v0.4.4...v0.4.8)
- [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pyproject.toml

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: skshetry <18718008+skshetry@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] and skshetry authored Jun 15, 2024
1 parent 4cdec35 commit 17f56cf
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
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.4.4'
rev: 'v0.4.8'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: ["tomli"]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ ignore_missing_imports = true

[tool.codespell]
ignore-words-list = "cachable, keypair"
skip = "CODE_OF_CONDUCT.rst"

[tool.ruff]
output-format = "full"
Expand Down
8 changes: 4 additions & 4 deletions src/scmrepo/git/backend/dulwich/asyncssh_vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ async def _read(self, n: Optional[int] = None) -> bytes:
class AsyncSSHWrapper(BaseAsyncObject):
def __init__(self, conn: "SSHClientConnection", proc: "SSHClientProcess", **kwargs):
super().__init__(**kwargs)
self.conn: "SSHClientConnection" = conn
self.proc: "SSHClientProcess" = proc
self.conn: SSHClientConnection = conn
self.proc: SSHClientProcess = proc
self.stderr = _StderrWrapper(proc.stderr, self.loop)

def can_read(self) -> bool:
Expand Down Expand Up @@ -152,7 +152,7 @@ def connection_made(self, conn: "SSHClientConnection") -> None:
def connection_lost(self, exc: Optional[Exception]) -> None:
self._conn = None

async def public_key_auth_requested( # noqa: C901, PLR0912
async def public_key_auth_requested( # noqa: C901
self,
) -> Optional["KeyPairListArg"]:
from asyncssh.public_key import (
Expand Down Expand Up @@ -320,7 +320,7 @@ def get_unsupported_opts(config_paths: "ConfigPaths") -> Iterator[str]:

if config_paths:
if isinstance(config_paths, (str, PurePath)):
paths: Sequence["FilePath"] = [config_paths]
paths: Sequence[FilePath] = [config_paths]
else:
paths = config_paths

Expand Down
2 changes: 1 addition & 1 deletion src/scmrepo/git/backend/dulwich/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(
config=config,
**kwargs,
)
self._store_credentials: Optional["Credential"] = None
self._store_credentials: Optional[Credential] = None

def _http_request(
self,
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 @@ -468,7 +468,7 @@ def set_ref(
except GitCommandError as exc:
raise SCMError(f"Failed to set ref '{name}'") from exc

def get_ref(self, name: str, follow: bool = True) -> Optional[str]: # noqa: C901, PLR0911, PLR0912
def get_ref(self, name: str, follow: bool = True) -> Optional[str]: # noqa: C901, PLR0911
from git.exc import GitCommandError

if name == "HEAD":
Expand Down
8 changes: 4 additions & 4 deletions src/scmrepo/git/backend/pygit2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def _default_status(
SCMError(f"Git failed to fetch ref from '{url}'"),
):
with RemoteCallbacks(progress=progress) as cb:
remote_refs: dict[str, "Oid"] = (
remote_refs: dict[str, Oid] = (
{
head["name"]: head["oid"]
for head in remote.ls_remotes(callbacks=cb)
Expand All @@ -712,7 +712,7 @@ def _default_status(
message="fetch",
)

result: dict[str, "SyncStatus"] = {}
result: dict[str, SyncStatus] = {}
for refspec in refspecs:
lh, rh = refspec.split(":")
if lh.endswith("*"):
Expand Down Expand Up @@ -951,7 +951,7 @@ def status(
def iter_remote_refs(self, url: str, base: Optional[str] = None, **kwargs):
raise NotImplementedError

def merge( # noqa: C901, PLR0912
def merge( # noqa: C901
self,
rev: str,
commit: bool = True,
Expand Down Expand Up @@ -1089,7 +1089,7 @@ def check_attr(
from pygit2 import GitError
from pygit2.enums import AttrCheck

commit: Optional["Commit"] = None
commit: Optional[Commit] = None
flags = AttrCheck.FILE_THEN_INDEX
if source:
try:
Expand Down
2 changes: 1 addition & 1 deletion src/scmrepo/git/backend/pygit2/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(
):
super().__init__(*args, **kwargs)
self.progress = GitProgressReporter(progress) if progress else None
self._store_credentials: Optional["Credential"] = None
self._store_credentials: Optional[Credential] = None
self._tried_credentials = False
self.result: dict[str, SyncStatus] = {}

Expand Down
4 changes: 2 additions & 2 deletions src/scmrepo/git/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def get_matching_commands(
) -> Iterator[tuple[str, bool]]:
config = config or StackedConfig.default()
if isinstance(config, StackedConfig):
backends: Iterable["ConfigDict"] = config.backends
backends: Iterable[ConfigDict] = config.backends
else:
backends = [config]

Expand Down Expand Up @@ -324,7 +324,7 @@ class MemoryCredentialHelper(CredentialHelper):

def __init__(self):
super().__init__()
self._credentials: dict["_CredentialKey", "Credential"] = {}
self._credentials: dict[_CredentialKey, Credential] = {}

def __getitem__(self, key: object) -> "Credential":
if isinstance(key, _CredentialKey):
Expand Down
4 changes: 2 additions & 2 deletions src/scmrepo/git/lfs/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def fetch(
scm.lfs_storage.fetch(url, objects, progress=progress)


def get_fetch_url(scm: "Git", remote: Optional[str] = None): # noqa: C901,PLR0912
def get_fetch_url(scm: "Git", remote: Optional[str] = None): # noqa: C901
"""Return LFS fetch URL for the specified repository."""
git_config = scm.get_config()

Expand All @@ -56,7 +56,7 @@ def get_fetch_url(scm: "Git", remote: Optional[str] = None): # noqa: C901,PLR09
except KeyError:
pass
try:
lfs_config: Optional["Config"] = scm.get_config(
lfs_config: Optional[Config] = scm.get_config(
os.path.join(scm.root_dir, ".lfsconfig")
)
except FileNotFoundError:
Expand Down

0 comments on commit 17f56cf

Please sign in to comment.