google / google/yapf

Split type hints with trailing comma

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

Description

Type hints aren't being split on separate lines even though arguments are. What's the correct setting to get consistent formatting?

Incorrect
```
argument: Optional[Union[SomeType,
Tuple[SomeType, int],
Sequence[Union[SomeType, Tuple[SomeType, int]]],
]] = None,
```

Correct
```
argument: Optional[Union[
SomeType,
Tuple[SomeType, int],
Sequence[Union[SomeType, Tuple[SomeType, int]]],
]] = None,
```

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.