Skip to content

Standardise number of blank newlines #115

Open
@ewels

Description

@ewels

We should standardise the number of blank newlines that are allowed around things.

For example, with Python we have PEP8 which says:

Surround top-level function and class definitions with two blank lines.

Method definitions inside a class are surrounded by a single blank line.

Extra blank lines may be used (sparingly) to separate groups of related functions. Blank lines may be omitted between a bunch of related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical sections.

Functionally, this means that code formatters add newlines where needed and collapse newlines where there are too many. I think that Ruff formatter adds 2 newlines after def and class and allows a maximum of 2 newlines between arbitrary code, for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    formattingRelated to automatic code formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions