google / google/yapf

Different rules for PYI files

Open
#1,247 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

Ruff complains: https://docs.astral.sh/ruff/rules/too-many-blank-lines/#typing-stub-files-pyi

A fix would be akin to `blank_lines_around_top_level_definition=1` in all PYI files.

Relevant doc: https://typing.readthedocs.io/en/latest/guides/writing_stubs.html#blank-lines

There are other issues like adding a line between the attributes and methods of a class.

```
class X:
x: int
y: int
<-- blank line should not get added
def __getitem__(self, key: str) -> Any:
```

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.