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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

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

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.

None yet

3 participants