Skip to content

Commit 17f56cf

Browse files
[pre-commit.ci] pre-commit autoupdate (#364)
* [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>
1 parent 4cdec35 commit 17f56cf

File tree

9 files changed

+18
-17
lines changed

9 files changed

+18
-17
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ repos:
2020
- id: sort-simple-yaml
2121
- id: trailing-whitespace
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: 'v0.4.4'
23+
rev: 'v0.4.8'
2424
hooks:
2525
- id: ruff
2626
args: [--fix, --exit-non-zero-on-fix]
2727
- id: ruff-format
2828
- repo: https://github.com/codespell-project/codespell
29-
rev: v2.2.6
29+
rev: v2.3.0
3030
hooks:
3131
- id: codespell
3232
additional_dependencies: ["tomli"]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ ignore_missing_imports = true
123123

124124
[tool.codespell]
125125
ignore-words-list = "cachable, keypair"
126+
skip = "CODE_OF_CONDUCT.rst"
126127

127128
[tool.ruff]
128129
output-format = "full"

src/scmrepo/git/backend/dulwich/asyncssh_vendor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ async def _read(self, n: Optional[int] = None) -> bytes:
6666
class AsyncSSHWrapper(BaseAsyncObject):
6767
def __init__(self, conn: "SSHClientConnection", proc: "SSHClientProcess", **kwargs):
6868
super().__init__(**kwargs)
69-
self.conn: "SSHClientConnection" = conn
70-
self.proc: "SSHClientProcess" = proc
69+
self.conn: SSHClientConnection = conn
70+
self.proc: SSHClientProcess = proc
7171
self.stderr = _StderrWrapper(proc.stderr, self.loop)
7272

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

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

321321
if config_paths:
322322
if isinstance(config_paths, (str, PurePath)):
323-
paths: Sequence["FilePath"] = [config_paths]
323+
paths: Sequence[FilePath] = [config_paths]
324324
else:
325325
paths = config_paths
326326

src/scmrepo/git/backend/dulwich/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222
config=config,
2323
**kwargs,
2424
)
25-
self._store_credentials: Optional["Credential"] = None
25+
self._store_credentials: Optional[Credential] = None
2626

2727
def _http_request(
2828
self,

src/scmrepo/git/backend/gitpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def set_ref(
468468
except GitCommandError as exc:
469469
raise SCMError(f"Failed to set ref '{name}'") from exc
470470

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

474474
if name == "HEAD":

src/scmrepo/git/backend/pygit2/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def _default_status(
698698
SCMError(f"Git failed to fetch ref from '{url}'"),
699699
):
700700
with RemoteCallbacks(progress=progress) as cb:
701-
remote_refs: dict[str, "Oid"] = (
701+
remote_refs: dict[str, Oid] = (
702702
{
703703
head["name"]: head["oid"]
704704
for head in remote.ls_remotes(callbacks=cb)
@@ -712,7 +712,7 @@ def _default_status(
712712
message="fetch",
713713
)
714714

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

954-
def merge( # noqa: C901, PLR0912
954+
def merge( # noqa: C901
955955
self,
956956
rev: str,
957957
commit: bool = True,
@@ -1089,7 +1089,7 @@ def check_attr(
10891089
from pygit2 import GitError
10901090
from pygit2.enums import AttrCheck
10911091

1092-
commit: Optional["Commit"] = None
1092+
commit: Optional[Commit] = None
10931093
flags = AttrCheck.FILE_THEN_INDEX
10941094
if source:
10951095
try:

src/scmrepo/git/backend/pygit2/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(
2828
):
2929
super().__init__(*args, **kwargs)
3030
self.progress = GitProgressReporter(progress) if progress else None
31-
self._store_credentials: Optional["Credential"] = None
31+
self._store_credentials: Optional[Credential] = None
3232
self._tried_credentials = False
3333
self.result: dict[str, SyncStatus] = {}
3434

src/scmrepo/git/credentials.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def get_matching_commands(
243243
) -> Iterator[tuple[str, bool]]:
244244
config = config or StackedConfig.default()
245245
if isinstance(config, StackedConfig):
246-
backends: Iterable["ConfigDict"] = config.backends
246+
backends: Iterable[ConfigDict] = config.backends
247247
else:
248248
backends = [config]
249249

@@ -324,7 +324,7 @@ class MemoryCredentialHelper(CredentialHelper):
324324

325325
def __init__(self):
326326
super().__init__()
327-
self._credentials: dict["_CredentialKey", "Credential"] = {}
327+
self._credentials: dict[_CredentialKey, Credential] = {}
328328

329329
def __getitem__(self, key: object) -> "Credential":
330330
if isinstance(key, _CredentialKey):

src/scmrepo/git/lfs/fetch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def fetch(
4646
scm.lfs_storage.fetch(url, objects, progress=progress)
4747

4848

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

@@ -56,7 +56,7 @@ def get_fetch_url(scm: "Git", remote: Optional[str] = None): # noqa: C901,PLR09
5656
except KeyError:
5757
pass
5858
try:
59-
lfs_config: Optional["Config"] = scm.get_config(
59+
lfs_config: Optional[Config] = scm.get_config(
6060
os.path.join(scm.root_dir, ".lfsconfig")
6161
)
6262
except FileNotFoundError:

0 commit comments

Comments
 (0)