Skip to content

Add a mode for pyi files #207

@JelleZijlstra

Description

@JelleZijlstra

This is a feature request; we talked about this in person briefly yesterday.

Here's what it could look like:

  • Black automatically formats *.pyi files in a package in addition to *.py files
  • Stub files mostly follow the same convention with a few changes, as follows:
    • If the body of a function or class is just ..., don't put it on a separate line, but just put it after the :
    • Don't put blank lines between methods or functions, or between classes with an empty body
    • Only put one blank line between other classes.
    • Potentially allow longer lines. Typeshed's coding conventions currently allow infinite-length lines, but I'm not sure we should keep doing that.

See https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#conventions for reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions