Black: Add a mode for pyi files

Created on 14 May 2018  路  1Comment  路  Source: psf/black

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.

enhancement help wanted

Most helpful comment

I started working on this.

>All comments

I started working on this.

Was this page helpful?
0 / 5 - 0 ratings