-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
A lot of classes in refex predate the attrs type argument, so that they look like this:
@attr.s(...)
class Foo(...)
x = attr.ib(...) # type: SomeTypeHereThe new form is:
@attr.s(...)
class Foo(...)
x = attr.ib(..., type=SomeTypeHere)Benefits of the new form:
- shows up in documentation.
- better-supported by tools
- formats way better when you need to break across lines etc.
It might be a neat thing to do to, well, automate this via refex and apply it to refex itself. ;) It's a nontrivial matcher, because it involves editing (removing) a comment and editing the arguments to a function, which makes it useful as a demonstration of how to do nontrivial things with Refex. Since pretty much the only time anyone wants to use Refex is when it's something nontrivial, well...
Metadata
Metadata
Assignees
Labels
No labels