Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#294)
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.3 → v0.4.8](astral-sh/ruff-pre-commit@v0.4.3...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 fe4c7a0 commit 70a3778
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 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.3'
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 @@ -101,6 +101,7 @@ module = [

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

[tool.ruff]
output-format = "full"
Expand Down
2 changes: 1 addition & 1 deletion src/dvc_objects/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def add_bytes(self, oid: str, data: Union[bytes, BinaryIO]) -> None:
raise ObjectDBPermissionError("Cannot add to read-only ODB")

if isinstance(data, bytes):
fobj: "BinaryIO" = BytesIO(data)
fobj: BinaryIO = BytesIO(data)
size: Optional[int] = len(data)
else:
fobj = data
Expand Down
2 changes: 1 addition & 1 deletion src/dvc_objects/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def create_taskset(n: int) -> dict[asyncio.Task, int]:
for fut in done:
try:
result = fut.result()
except Exception as exc: # noqa: BLE001
except Exception as exc:
if not return_exceptions:
for pending_fut in pending:
pending_fut.cancel()
Expand Down
8 changes: 4 additions & 4 deletions src/dvc_objects/fs/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _copy_one(from_p: "AnyFSPath", to_p: "AnyFSPath"):
return to_fs.put_file(
fobj, to_p, size=size, callback=child, **put_file_kwargs
)
except Exception as exc: # noqa: BLE001
except Exception as exc:
if on_error is not None:
on_error(from_p, to_p, exc)
else:
Expand Down Expand Up @@ -151,7 +151,7 @@ def _put_one(from_path: "AnyFSPath", to_path: "AnyFSPath"):
return to_fs.put_file(
from_path, to_path, callback=child, **put_file_kwargs
)
except Exception as exc: # noqa: BLE001
except Exception as exc:
if on_error is not None:
on_error(from_path, to_path, exc)
else:
Expand Down Expand Up @@ -217,7 +217,7 @@ def _get_one(from_path: "AnyFSPath", to_path: "AnyFSPath"):
return from_fs.get_file(
from_path, tmp_file, callback=child, **get_file_kwargs
)
except Exception as exc: # noqa: BLE001
except Exception as exc:
if on_error is not None:
on_error(from_path, to_path, exc)
else:
Expand Down Expand Up @@ -375,7 +375,7 @@ def transfer( # noqa: PLR0912, C901
on_error(from_p, to_p, exc)
else:
raise
except Exception as exc: # noqa: BLE001
except Exception as exc:
if on_error is not None:
on_error(from_p, to_p, exc)
else:
Expand Down

0 comments on commit 70a3778

Please sign in to comment.