Skip to content
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

Fix Ruby 2.7 keyword deprecation warning in validators/coerce #2131

Conversation

K0H205
Copy link
Contributor

@K0H205 K0H205 commented Nov 17, 2020

Fix these deprecation warnings

grape/lib/grape/validations/validators/coerce.rb:21: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
grape/lib/grape/validations/validators/base.rb:16: warning: The called method `initialize' is defined here

@dblock
Copy link
Member

dblock commented Nov 17, 2020

Is there any way we can fail CI when we have these warnings? Maybe a Danger plugin?

@K0H205 K0H205 changed the title Fix Ruby 2.7 keyword deprecations in validators/coerce Fix Ruby 2.7 keyword deprecation warning in validators/coerce Nov 17, 2020
@grape-bot
Copy link

1 Warning
⚠️ There’re library changes, but not tests. That’s OK as long as you’re refactoring existing code.

Generated by 🚫 danger

@K0H205
Copy link
Contributor Author

K0H205 commented Nov 17, 2020

Is there any way we can fail CI when we have these warnings?

I can't suggest enough ways to make CI fail with ruby warnings.

@dblock dblock merged commit 94c9d6f into ruby-grape:master Nov 18, 2020
@K0H205 K0H205 deleted the fix/ruby-2.7-keyword-deprecations_coerce_validator branch November 18, 2020 00:55
@eregon
Copy link
Contributor

eregon commented Nov 19, 2020

Is there any way we can fail CI when we have these warnings? Maybe a Danger plugin?

The warning gem could be use to turn warnings into exceptions, that might be one way.

@dblock
Copy link
Member

dblock commented Nov 19, 2020

@eregon You'll be my hero if you can make it work.

@dblock
Copy link
Member

dblock commented Nov 19, 2020

Btw, I had tried in spec_helper to override warn, which worked. The problem was that I couldn't have both specs that expect warnings and always fail on unexpected warnings without some nasty hack. I might retry this.

@eregon
Copy link
Contributor

eregon commented Nov 19, 2020

That gem seems to allow filtering warnings like :keyword_separation so that might be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants