"visually indented line with same indent as next logical line" on function def
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
With 0.29, there is a regression on the way function definition is defined.
For example, Before this was formatted correctly by yapf:
```python
# when using click, long function def can happen
def entrypoint(
ctx,
mode,
config,
# only,
myserver,
projects,
verbose,
validate,
myserver_url,
myserver_token,
report_file,
report_html,
color,
diff,
debug,
config_project_url,
configured_by_mytool_badge_url,
accepted_external_badge_image_urls,
smtp_server,
smtp_port,
watchers,
sentry_dsn,
gelf_host,
gelf_level,
old_configured_by_mytool_badge_urls):
if color == "force":
if color == "force":
ctx.color = True
```
After 0.27:
```python
def entrypoint(
ctx,
mode,
config,
# only,
myserver,
projects,
verbose,
validate,
myserver_url,
myserver_token,
report_file,
report_html,
color,
diff,
debug,
config_project_url,
configured_by_mytool_badge_url,
accepted_external_badge_image_urls,
smtp_server,
smtp_port,
watchers,
sentry_dsn,
gelf_host,
gelf_level,
old_configured_by_mytool_badge_urls):
if color == "force":
...
```
I would like to keep the old behavior, because I find much more maintainable, to be able to distinguish between list of parameter and the indentation of the block.
At least please provide an option/knob, such as "overindent_def", so that user can opt-in if they want.
Today, I have to yapf:disable these block
Contributor guide
Assessment
This issue has not been assessed yet.