-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Cleanup ameba warnings #551
Conversation
a933db4
to
cd3124c
Compare
@@ -1,6 +1,7 @@ | |||
class HTTP::Server::Response | |||
class Output | |||
def close | |||
# ameba:disable Style/NegatedConditionsInUnless | |||
unless response.wrote_headers? && !response.headers.has_key?("Content-Range") |
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.
can this be turned into an if statement?
if !response.wrote_headers? && response.headers.has_key?("Content-Range")
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.
See #538
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.
Please let's not do that again 😸
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.
The correct way of using if
here is:
if !response.wrote_headers? || response.headers.has_key?("Content-Range")
@@ -4,6 +4,7 @@ | |||
|
|||
module Kemal | |||
class StaticFileHandler < HTTP::StaticFileHandler | |||
# ameba:disable Metrics/CyclomaticComplexity |
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.
Would this be worth tuning instead of ignoring?
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.
I'd leave it for another PR.
cd3124c
to
e8330ed
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.
Thank you @Sija 👍
Followup to #520, #538