Skip to content

Commit

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

updates:
- [github.com/psf/black: 24.3.0 → 24.4.0](psf/black@24.3.0...24.4.0)
- [github.com/astral-sh/ruff-pre-commit: v0.3.5 → v0.3.7](astral-sh/ruff-pre-commit@v0.3.5...v0.3.7)

* fixed linter warnings
* removed "mypy"

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 16, 2024
1 parent 54aef8c commit 3a61881
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .github/transform_to-pi_heif.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
data = pathlib.Path(file_name).read_text(encoding="utf-8")
modified_data = data.replace("pillow_heif", "pi_heif")
if modified_data != data:
with open(file_name + DEV_NAME_ADD, "w") as file:
file.write(modified_data)
pathlib.Path(file_name + DEV_NAME_ADD).write_text(modified_data)

os.rename("pillow_heif/_pillow_heif.c", "pillow_heif/_pi_heif.c")
os.rename("pillow_heif", "pi_heif")
11 changes: 2 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.0
hooks:
- id: black

Expand All @@ -29,17 +29,10 @@ repos:
- id: pyproject-fmt

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

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
files: pillow_heif/
additional_dependencies: [pillow, pytest]

- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
Expand Down
2 changes: 1 addition & 1 deletion pillow_heif/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _get_orientation(info: dict, reset: bool = False) -> Optional[int]:
except Exception: # noqa # pylint: disable=broad-except
pass
xmp_orientation = _get_orientation_xmp(info, original_orientation, reset=reset)
return xmp_orientation if xmp_orientation else original_orientation
return xmp_orientation or original_orientation


def get_file_mimetype(fp) -> str:
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ preview = true
line-length = 120
preview = true
target-version = "py38"
select = ["A", "B", "C", "D", "E", "F", "FURB", "G", "I", "S", "SIM", "PERF", "PIE", "Q", "RET", "RUF", "UP" , "W"]
extend-ignore = ["D107", "D105", "D203", "D213", "D401", "E203", "I001", "RUF100"]
lint.select = ["A", "B", "C", "D", "E", "F", "FURB", "G", "I", "S", "SIM", "PERF", "PIE", "Q", "RET", "RUF", "UP" , "W"]
lint.extend-ignore = ["D107", "D105", "D203", "D213", "D401", "E203", "I001", "RUF100"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"pillow_heif/__init__.py" = ["F401"]
"setup.py" = ["S"]

[tool.ruff.extend-per-file-ignores]
[tool.ruff.lint.extend-per-file-ignores]
"benchmarks/**/*.py" = ["D", "S404", "S603"]
"docs/**/*.py" = ["D"]
"examples/**/*.py" = ["D", "PERF"]
"libheif/**/*.py" = ["D", "PERF", "S"]
"tests/**/*.py" = ["B009", "D", "E402", "PERF", "S", "UP"]

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

[tool.isort]
Expand Down

0 comments on commit 3a61881

Please sign in to comment.