google / google/yapf

break (type annotation) comment into next line instead of function definition

Open
#971 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

currently long function function definitions with type annotation comments get spliited into multiple lines:
```patch
- def __init__(self, co, lo, position, dn=u'', superordinate=None, attributes=None): # type: (None, access, position, Text, Any, _Attributes) -> None
+ def __init__(
+ self, co, lo, position, dn=u'', superordinate=None, attributes=None
+ ): # type: (None, access, position, Text, Any, _Attributes) -> None
```

I would like the result to be:
```patch
- def __init__(self, co, lo, position, dn=u'', superordinate=None, attributes=None): # type: (None, access, position, Text, Any, _Attributes) -> None
+ def __init__(self, co, lo, position, dn=u'', superordinate=None, attributes=None)
+ # type: (None, access, position, Text, Any, _Attributes) -> None
```

not necessarily only for type annotation comments. I think there are more use cases for splitting the comment instead of something else.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.