Skip to content

Different rules for PYI files #1247

@Tatsh

Description

@Tatsh

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions