Open stefanoborini opened 1 year ago
@stefanoborini I'm 👍 on this but I do want to point out that your formatting suggestion actually does not comply with PEP8:
The closing brace/bracket/parenthesis on multiline constructs may either line up under the first non-whitespace character of the last line of list, as in: [...] or it may be lined up under the first character of the line that starts the multiline construct, as in: [...]
Not that I blame you, I do actually quite like that construct. But in the spirit of following PEP8 — it bugs me that black explicitly breaks with it so I shouldn't be tempted to do the same when convenient — I think it should be:
def very_important_function(
template: str,
*variables,
file: os.PathLike,
debug: bool = False,
):
code
code
This is how I've configured my yapf style. But yapf is no longer maintained. 😭
Ah, note that this is actually a duplicate of #89
This particular style choice of Black also troubles me. That's what motivated me to start a more configurable formatter based on a fork from Black: https://github.com/jsh9/cercis
My project already supports indenting by 8 spaces at function definitions. And I plan to add more configurable options.
Please feel free to try it out and provide feedback.
This:
Should be formatted like this
To comply with PEP-8 indentation directives: