google / google/yapf

Yapf does not format some function

Open
#910 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

I want all my function to look like these
`def some_thing(
param_dict: dict,
depth_polar: np.ndarray,
intensity_polar: Optional[np.ndarray] = None,
) -> Tuple[np.ndarray, np.ndarray]:
pass`
![image](https://user-images.githubusercontent.com/22574885/113904300-eefbb680-979f-11eb-9adc-ee1ea11074b6.png)

And yapf format it well for most of the time but there is one function where it does not work :

`def another_thing(polar: np.ndarray,
circles: np.ndarray,
r_min_px: int,
dist_max_px: int = 10) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
pass`
![image](https://user-images.githubusercontent.com/22574885/113904332-f58a2e00-979f-11eb-8380-35d67bb8c158.png)

Both functions are in the same file...

Here are my arguments usinge VS Code format on save :
--style
{based_on_style: pep8, column_limit: 120, DEDENT_CLOSING_BRACKETS: true}

I use VS Code and yapf v0.31.0

[yapf_example.zip](https://github.com/google/yapf/files/6273238/yapf_example.zip)

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.