Skip to content

Formatter: Target version support #7234

@MichaReiser

Description

@MichaReiser

Adjust the formatting based on the syntax supported by the targeted python versions.

Black uses this option to decide what grammar to use to parse your code. In addition, it may use it to decide what style to use. For example, support for a trailing comma after *args in a function call was added in Python 3.5, so Black will add this comma only if the target versions are all Python 3.5 or higher.

Source

  • Decide on minimal supported python version
  • Trailing args and kwargs comments (depending on the above decision)
  • Parenthesized with items

Relevant features:

Metadata

Metadata

Assignees

Labels

formatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions