-
Notifications
You must be signed in to change notification settings - Fork 508
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
Enforce that parameters position with sorbet-static #1273
Conversation
While I do like the proposed requirement, as it makes the code more readable. WDYT about making this into a separate error class that is enabled in BTW: thank you for great tests |
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.
due to ^^^ I expect this will break a lot of people.
Let's make it less invasive by making it a:
- separate error code
- that's only enabled at
strict
and higher
The problem we have with the current state is that To avoid this problem we have two cops ran on CI especially for the parameters ordering:
My goal with this PR was to remove the need of these cops. Moving this check to I added a commit to bind these errors to another class especially for the parameters ordering: WDYT about leaving this in |
our current policy is that the moment you blacklist an error, you're not supported, thus I'd like to not introduce a common error that open-source folks will blacklist.
Let me carefully see how many breackages does this have in open-source & in our repo to get indication if this is problematic in practice and get inspiration for how can we address all usecases here. |
Hi Alexandre, |
…ones Also add a test showing the new spec. Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
^ @DarkDimius rebased on master. Thank you! |
@DarkDimius is there something else to do with this pull request? |
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.
Working on landing it
Thank you, sorry it took so long! |
Motivation
There are three mismatch between sorbet-static and sorbet-runtime regarding parameters:
None of these checks are implemented in sorbet-static yet.
This pull-request implements
2.
and3.
.For
1.
, it is possible to implement it but it conflicts with some definitions insocket.rbi
.Test plan
Few examples from the tests:
See included automated tests.
Closes #174.