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

Adjusting to PEP8 Style for function with long list of parameters #2117

Closed
nbievre opened this issue Apr 18, 2021 · 3 comments
Closed

Adjusting to PEP8 Style for function with long list of parameters #2117

nbievre opened this issue Apr 18, 2021 · 3 comments
Labels
R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?

Comments

@nbievre
Copy link

nbievre commented Apr 18, 2021

Describe the style change:
Add an extra level of indentation in the list of arguments of functions with long list of arguments to respect the PEP8 style guidelines.

The PEP8 style guidelines suggests to "Add an extra level of indentation to distinguish arguments from the rest" of the function. However, the Black formatter does not add this extra level of indentation which makes less PEP8 compliant.

Examples in the current Black style :

def function_name(
    arg1: int,
    arg2: int,
) -> int:
    return 2 * arg1 + arg2

Desired style How do you think Black should format the above snippets:

def function_name(
        arg1: int,
        arg2: int,
) -> int:
    return 2 * arg1 + arg2
@nbievre nbievre added the T: style What do we want Blackened code to look like? label Apr 18, 2021
@JelleZijlstra
Copy link
Collaborator

We're unlikely to change such a basic aspect of Black's formatting at this time.

@ichard26
Copy link
Collaborator

See also GH-48, GH-1178, and GH-1127.

@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Apr 18, 2021
@nbievre
Copy link
Author

nbievre commented Apr 18, 2021

Noted! Thanks for the quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

3 participants