Skip to content

Commit

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

updates:
- [github.com/tox-dev/pyproject-fmt: 1.7.0 → 1.8.0](tox-dev/pyproject-fmt@1.7.0...1.8.0)
- [github.com/astral-sh/ruff-pre-commit: v0.3.7 → v0.4.1](astral-sh/ruff-pre-commit@v0.3.7...v0.4.1)

* correction from "ruff" tool

Signed-off-by: Alexander Piskun <[email protected]>

---------

Signed-off-by: Alexander Piskun <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alexander Piskun <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and bigcat88 authored Apr 23, 2024
1 parent bca8695 commit db12928
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ repos:
- id: black

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
rev: 1.8.0
hooks:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.7
rev: v0.4.1
hooks:
- id: ruff

Expand Down
3 changes: 1 addition & 2 deletions pillow_heif/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,7 @@ def save(self, fp) -> None:
"""Ask encoder to produce output based on previously added images."""
data = self.ctx_write.finalize()
if isinstance(fp, (str, Path)):
with builtins.open(fp, "wb") as f:
f.write(data)
Path(fp).write_bytes(data)
elif hasattr(fp, "write"):
fp.write(data)
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ lint.extend-ignore = ["D107", "D105", "D203", "D213", "D401", "E203", "I001", "R
"docs/**/*.py" = ["D"]
"examples/**/*.py" = ["D", "PERF"]
"libheif/**/*.py" = ["D", "PERF", "S"]
"tests/**/*.py" = ["B009", "D", "E402", "PERF", "S", "UP"]
"tests/**/*.py" = ["B009", "D", "E402", "PERF", "S", "UP", "SIM115"]

[tool.ruff.lint.mccabe]
max-complexity = 16
Expand Down

0 comments on commit db12928

Please sign in to comment.