Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Fix multi-token type hints in line formatter #158

@jakebailey

Description

@jakebailey

The line formatter handles the spacing of = inside of a function declaration with a type hint by looking two tokens behind the = to see if there's a colon. This works for simple declarations like def foo(a: str = "bar"), but does not work for more complicated types such as def foo(a: Union[int, str] = "bar").

A more correct method would be to look for a colon anywhere behind the = until reaching a ( or ,.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions