Skip to content

Commit 3e04ca5

Browse files
authored
Merge pull request #7780 from python-pillow/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 1b67239 + 5f115df commit 3e04ca5

20 files changed

+34
-28
lines changed

.github/workflows/system-info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Requested here:
77
https://github.com/actions/virtual-environments/issues/79
88
"""
9+
910
from __future__ import annotations
1011

1112
import os

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.1.9
3+
rev: v0.2.0
44
hooks:
55
- id: ruff
66
args: [--fix, --exit-non-zero-on-fix]
77

88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 23.12.1
9+
rev: 24.1.1
1010
hooks:
1111
- id: black
1212

1313
- repo: https://github.com/PyCQA/bandit
14-
rev: 1.7.6
14+
rev: 1.7.7
1515
hooks:
1616
- id: bandit
1717
args: [--severity-level=high]
@@ -48,12 +48,12 @@ repos:
4848
- id: sphinx-lint
4949

5050
- repo: https://github.com/tox-dev/pyproject-fmt
51-
rev: 1.5.3
51+
rev: 1.7.0
5252
hooks:
5353
- id: pyproject-fmt
5454

5555
- repo: https://github.com/abravalheri/validate-pyproject
56-
rev: v0.15
56+
rev: v0.16
5757
hooks:
5858
- id: validate-pyproject
5959

Tests/helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Helper functions.
33
"""
4+
45
from __future__ import annotations
56

67
import logging

Tests/test_file_dds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test DdsImagePlugin"""
2+
23
from __future__ import annotations
34

45
from io import BytesIO

Tests/test_file_libtiff_small.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class TestFileLibTiffSmall(LibTiffTestCase):
12-
1312
"""The small lena image was failing on open in the libtiff
1413
decoder because the file pointer was set to the wrong place
1514
by a spurious seek. It wasn't failing with the byteio method.

Tests/test_image_access.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,7 @@ def test_list(self) -> None:
230230
assert im.getpixel([0, 0]) == (20, 20, 70)
231231

232232
@pytest.mark.parametrize("mode", ("I;16", "I;16B"))
233-
@pytest.mark.parametrize(
234-
"expected_color", (2**15 - 1, 2**15, 2**15 + 1, 2**16 - 1)
235-
)
233+
@pytest.mark.parametrize("expected_color", (2**15 - 1, 2**15, 2**15 + 1, 2**16 - 1))
236234
def test_signedness(self, mode, expected_color) -> None:
237235
# see https://github.com/python-pillow/Pillow/issues/452
238236
# pixelaccess is using signed int* instead of uint*

Tests/test_image_resize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests for resize functionality.
33
"""
4+
45
from __future__ import annotations
56

67
from itertools import permutations

Tests/test_imagecms.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,11 @@ def assert_truncated_tuple_equal(tup1, tup2, digits: int = 10) -> None:
342342

343343
def truncate_tuple(tuple_or_float):
344344
return tuple(
345-
truncate_tuple(val)
346-
if isinstance(val, tuple)
347-
else int(val * power) / power
345+
(
346+
truncate_tuple(val)
347+
if isinstance(val, tuple)
348+
else int(val * power) / power
349+
)
348350
for val in tuple_or_float
349351
)
350352

docs/example/DdsImagePlugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Full text of the CC0 license:
1010
https://creativecommons.org/publicdomain/zero/1.0/
1111
"""
12+
1213
from __future__ import annotations
1314

1415
import struct

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,33 +96,33 @@ config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable"
9696
test-command = "cd {project} && .github/workflows/wheels-test.sh"
9797
test-extras = "tests"
9898

99-
[tool.ruff]
99+
[tool.ruff.lint]
100100
select = [
101101
"C4", # flake8-comprehensions
102102
"E", # pycodestyle errors
103103
"EM", # flake8-errmsg
104104
"F", # pyflakes errors
105105
"I", # isort
106106
"ISC", # flake8-implicit-str-concat
107+
"LOG", # flake8-logging
107108
"PGH", # pygrep-hooks
108109
"RUF100", # unused noqa (yesqa)
109110
"UP", # pyupgrade
110111
"W", # pycodestyle warnings
111112
"YTT", # flake8-2020
112-
# "LOG", # TODO: enable flake8-logging when it's not in preview anymore
113113
]
114-
extend-ignore = [
114+
ignore = [
115115
"E203", # Whitespace before ':'
116116
"E221", # Multiple spaces before operator
117117
"E226", # Missing whitespace around arithmetic operator
118118
"E241", # Multiple spaces after ','
119119
]
120120

121-
[tool.ruff.per-file-ignores]
121+
[tool.ruff.lint.per-file-ignores]
122122
"Tests/oss-fuzz/fuzz_font.py" = ["I002"]
123123
"Tests/oss-fuzz/fuzz_pillow.py" = ["I002"]
124124

125-
[tool.ruff.isort]
125+
[tool.ruff.lint.isort]
126126
known-first-party = ["PIL"]
127127
required-imports = ["from __future__ import annotations"]
128128

0 commit comments

Comments
 (0)