-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Avoid noise when code runs with Ruby warnings #1526
Conversation
4e234cc
to
746cd59
Compare
I think initializers such as |
I have done so in all the classes. The cases where I didn't are all modules in the |
Because those are included? I am not a huge fan of side-effects of assigning something on return to |
746cd59
to
4a28ef2
Compare
I agree that |
Sorry to bother you guys, I'm personally 👎 for this. There are some good points in the |
The discussion in the sequel repo is very interesting, also the references to the Ruby development. The I see that some of my changes may affect the performance of every API call, while others are only executed when the app is started. What do you think of changing only the occurrences in start-up code? |
I would be down with what you're proposing @cpetschnig. Initialization in |
4a28ef2
to
791912b
Compare
I updated the PR: |
@@ -5,6 +5,11 @@ module Middleware | |||
class Formatter < Base | |||
CHUNKED = 'chunked'.freeze | |||
|
|||
def initialize(*_) | |||
super | |||
@app_response = nil |
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.
maybe Base
class is a better place for this
New versions of RSpec have warnings turned on by default: # This setting enables warnings. It's recommended, but in some cases may # be too noisy due to issues in dependencies. config.warnings = true I believe these warnings are helpful in general to write better code. However, Grape and Grape Entity are very noisy. I get about 20 lines of warnings for one single test where Grape is involved. I hope you agree. Many of my changes could also be solved differently for sure. I am happy to discuss and change those cases. I also changed the specs for less warnings and turned them on in the test suite.
791912b
to
dba6064
Compare
Very true, I've changed it. |
It's very good, thanks @cpetschnig! |
🎉 |
Perfect, thanks! |
New versions of RSpec have warnings turned on by default:
I believe these warnings are helpful in general to write better code. However, Grape and Grape Entity are very noisy. I get about 20 lines of warnings for one single test where Grape is involved.
I hope you agree. Many of my changes could also be solved differently for sure. I am happy to discuss and change those cases. I also changed the specs for less warnings and turned them on in the test suite.