-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add final
, bind
, & implementation
to SignatureBuildOrder
#189
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably skip specs for these, as the existing specs don't exhaustively cover the builder methods.
The documentation should be updated though.
dbbdb2c
to
5e4384f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we took the order from an array in the configuration and we ship with a default (so we can use our preferred order and remove the old sig builders) but it enables people to use their own order and builders?
Yeah, I like this idea... |
Oh, yeah, in retrospect that's definitely the way to go. 👍 I'll update when I get a minute. |
Okay, I've updated the cop to extract a config, and added the missing methods to that config. |
ca2eca1
to
7d6bdcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Do you mind adding a test that changes the order config please?
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
7d6bdcc
to
171aa6f
Compare
I've added a test for the config change, and while doing that I realized I could improve the implementation to remove the need for |
96c2bbb
to
8d0a2c4
Compare
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks great and I think it just fell through the cracks.
If you can rebase it, we can merge and release.
This refactor removes the dependency on `unparser` for autocorrection, and teaches the cop to handle unknown builder methods by ignoring their ordering amongst known methods, rather than skipping the entire `sig`. Incidentally, it also migrates from the deprecated `RuboCop::Cop::Cop` class to `RuboCop::Cop::Base`.
8d0a2c4
to
e9be4a9
Compare
This teaches
SignatureBuildOrder
to also enforce the ordering offinal
,bind
, andimplementation
builder methods.As per #186 (comment)
It also includes a refactor which
unparser
, andSignatureBuildOrder
to handlesig
s which include unknown builder methods, rather than ignore themBefore Merging
SignatureBuildOrder
cop #186 is merged.