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

Change AlignAfterOpenBracket in .clang-format to BlockIndent #8067

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

Yay295
Copy link
Contributor

@Yay295 Yay295 commented May 19, 2024

Currently in Python when a function declaration is split across multiple lines, the closing parenthesis is on the same level as the def.

Pillow/src/PIL/Image.py

Lines 3484 to 3488 in c250a44

def register_open(
id,
factory: Callable[[IO[bytes], str | bytes], ImageFile.ImageFile],
accept: Callable[[bytes], bool | str] | None = None,
) -> None:

However currently in C the closing parenthesis is on the same line as the last argument.

/~https://github.com/hugovk/Pillow/blob/5597f618a3b5cf8e208dded44a2107313c47122d/src/libImaging/BcnDecode.c#L825-L833

static int
decode_bcn(
    Imaging im,
    ImagingCodecState state,
    const UINT8 *src,
    int bytes,
    int N,
    int C,
    char *pixel_format) {

It's the same with function calls as well.

This change changes the C style to match the Python style.

@Yay295 Yay295 force-pushed the patch-2 branch 2 times, most recently from a83cbac to ec208ac Compare May 23, 2024 13:16
@Yay295 Yay295 force-pushed the patch-2 branch 2 times, most recently from ffee8af to 6a8951f Compare June 22, 2024 14:11
@Yay295 Yay295 force-pushed the patch-2 branch 2 times, most recently from 60c87da to ba318ba Compare June 28, 2024 20:29
Copy link
Member

@homm homm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solves the issue described in #8212

@radarhere radarhere merged commit 011da4b into python-pillow:main Jul 19, 2024
49 of 52 checks passed
@Yay295 Yay295 deleted the patch-2 branch July 19, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants