Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #231

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading