Skip to content

Commit 070e1eb

Browse files
[pre-commit.ci] pre-commit autoupdate (#8993)
1 parent 95603e9 commit 070e1eb

File tree

10 files changed

+36
-27
lines changed

10 files changed

+36
-27
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.8
3+
rev: v0.11.12
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
@@ -24,7 +24,7 @@ repos:
2424
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$)
2525

2626
- repo: https://github.com/pre-commit/mirrors-clang-format
27-
rev: v20.1.3
27+
rev: v20.1.5
2828
hooks:
2929
- id: clang-format
3030
types: [c]
@@ -58,7 +58,7 @@ repos:
5858
- id: check-renovate
5959

6060
- repo: https://github.com/woodruffw/zizmor-pre-commit
61-
rev: v1.6.0
61+
rev: v1.9.0
6262
hooks:
6363
- id: zizmor
6464

@@ -68,7 +68,7 @@ repos:
6868
- id: sphinx-lint
6969

7070
- repo: https://github.com/tox-dev/pyproject-fmt
71-
rev: v2.5.1
71+
rev: v2.6.0
7272
hooks:
7373
- id: pyproject-fmt
7474

src/_imaging.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ _new_arrow(PyObject *self, PyObject *args) {
308308
}
309309

310310
// ImagingBorrowArrow is responsible for retaining the array_capsule
311-
ret =
312-
PyImagingNew(ImagingNewArrow(mode, xsize, ysize, schema_capsule, array_capsule)
313-
);
311+
ret = PyImagingNew(
312+
ImagingNewArrow(mode, xsize, ysize, schema_capsule, array_capsule)
313+
);
314314
if (!ret) {
315315
return ImagingError_ValueError("Invalid Arrow array mode or size mismatch");
316316
}
@@ -1665,7 +1665,8 @@ _putdata(ImagingObject *self, PyObject *args) {
16651665
int bigendian = 0;
16661666
if (image->type == IMAGING_TYPE_SPECIAL) {
16671667
// I;16*
1668-
if (strcmp(image->mode, "I;16B") == 0
1668+
if (
1669+
strcmp(image->mode, "I;16B") == 0
16691670
#ifdef WORDS_BIGENDIAN
16701671
|| strcmp(image->mode, "I;16N") == 0
16711672
#endif

src/display.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) {
327327
// added in Windows 10 (1607)
328328
// loaded dynamically to avoid link errors
329329
user32 = LoadLibraryA("User32.dll");
330-
SetThreadDpiAwarenessContext_function = (Func_SetThreadDpiAwarenessContext
331-
)GetProcAddress(user32, "SetThreadDpiAwarenessContext");
330+
SetThreadDpiAwarenessContext_function = (Func_SetThreadDpiAwarenessContext)
331+
GetProcAddress(user32, "SetThreadDpiAwarenessContext");
332332
if (SetThreadDpiAwarenessContext_function != NULL) {
333-
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext
334-
)GetProcAddress(user32, "GetWindowDpiAwarenessContext");
333+
GetWindowDpiAwarenessContext_function = (Func_GetWindowDpiAwarenessContext)
334+
GetProcAddress(user32, "GetWindowDpiAwarenessContext");
335335
if (screens == -1 && GetWindowDpiAwarenessContext_function != NULL) {
336336
dpiAwareness = GetWindowDpiAwarenessContext_function(wnd);
337337
}

src/libImaging/Fill.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ ImagingFillRadialGradient(const char *mode) {
118118

119119
for (y = 0; y < 256; y++) {
120120
for (x = 0; x < 256; x++) {
121-
d = (int
122-
)sqrt((double)((x - 128) * (x - 128) + (y - 128) * (y - 128)) * 2.0);
121+
d = (int)sqrt(
122+
(double)((x - 128) * (x - 128) + (y - 128) * (y - 128)) * 2.0
123+
);
123124
if (d >= 255) {
124125
d = 255;
125126
}

src/libImaging/Filter.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ ImagingFilter3x3(Imaging imOut, Imaging im, const float *kernel, float offset) {
155155
} else {
156156
int bigendian = 0;
157157
if (im->type == IMAGING_TYPE_SPECIAL) {
158-
if (strcmp(im->mode, "I;16B") == 0
158+
if (
159+
strcmp(im->mode, "I;16B") == 0
159160
#ifdef WORDS_BIGENDIAN
160161
|| strcmp(im->mode, "I;16N") == 0
161162
#endif
@@ -308,7 +309,8 @@ ImagingFilter5x5(Imaging imOut, Imaging im, const float *kernel, float offset) {
308309
} else {
309310
int bigendian = 0;
310311
if (im->type == IMAGING_TYPE_SPECIAL) {
311-
if (strcmp(im->mode, "I;16B") == 0
312+
if (
313+
strcmp(im->mode, "I;16B") == 0
312314
#ifdef WORDS_BIGENDIAN
313315
|| strcmp(im->mode, "I;16N") == 0
314316
#endif

src/libImaging/Jpeg2KEncode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ j2k_set_cinema_params(Imaging im, int components, opj_cparameters_t *params) {
207207

208208
if (params->cp_cinema == OPJ_CINEMA4K_24) {
209209
float max_rate =
210-
((float)(components * im->xsize * im->ysize * 8) / (CINEMA_24_CS_LENGTH * 8)
211-
);
210+
((float)(components * im->xsize * im->ysize * 8) /
211+
(CINEMA_24_CS_LENGTH * 8));
212212

213213
params->POC[0].tile = 1;
214214
params->POC[0].resno0 = 0;
@@ -243,8 +243,8 @@ j2k_set_cinema_params(Imaging im, int components, opj_cparameters_t *params) {
243243
params->max_comp_size = COMP_24_CS_MAX_LENGTH;
244244
} else {
245245
float max_rate =
246-
((float)(components * im->xsize * im->ysize * 8) / (CINEMA_48_CS_LENGTH * 8)
247-
);
246+
((float)(components * im->xsize * im->ysize * 8) /
247+
(CINEMA_48_CS_LENGTH * 8));
248248

249249
for (n = 0; n < params->tcp_numlayers; ++n) {
250250
rate = 0;

src/libImaging/Point.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ ImagingPoint(Imaging imIn, const char *mode, const void *table) {
197197
return imOut;
198198

199199
mode_mismatch:
200-
return (Imaging
201-
)ImagingError_ValueError("point operation not supported for this mode");
200+
return (Imaging)ImagingError_ValueError(
201+
"point operation not supported for this mode"
202+
);
202203
}
203204

204205
Imaging

src/libImaging/Resample.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,8 @@ ImagingResampleHorizontal_16bpc(
470470
double *k;
471471

472472
int bigendian = 0;
473-
if (strcmp(imIn->mode, "I;16N") == 0
473+
if (
474+
strcmp(imIn->mode, "I;16N") == 0
474475
#ifdef WORDS_BIGENDIAN
475476
|| strcmp(imIn->mode, "I;16B") == 0
476477
#endif
@@ -509,7 +510,8 @@ ImagingResampleVertical_16bpc(
509510
double *k;
510511

511512
int bigendian = 0;
512-
if (strcmp(imIn->mode, "I;16N") == 0
513+
if (
514+
strcmp(imIn->mode, "I;16N") == 0
513515
#ifdef WORDS_BIGENDIAN
514516
|| strcmp(imIn->mode, "I;16B") == 0
515517
#endif

src/libImaging/Storage.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,9 @@ ImagingBorrowArrow(
602602
}
603603

604604
if (!borrowed_buffer) {
605-
return (Imaging
606-
)ImagingError_ValueError("Arrow Array, exactly 2 buffers required");
605+
return (Imaging)ImagingError_ValueError(
606+
"Arrow Array, exactly 2 buffers required"
607+
);
607608
}
608609

609610
for (y = i = 0; y < im->ysize; y++) {

src/libImaging/TiffDecode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,8 @@ _decodeStrip(
557557
(tdata_t)state->buffer,
558558
strip_size
559559
) == -1) {
560-
TRACE(("Decode Error, strip %d\n", TIFFComputeStrip(tiff, state->y, 0))
560+
TRACE(
561+
("Decode Error, strip %d\n", TIFFComputeStrip(tiff, state->y, 0))
561562
);
562563
state->errcode = IMAGING_CODEC_BROKEN;
563564
return -1;

0 commit comments

Comments
 (0)