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

Cleanup ameba warnings #551

Merged
merged 1 commit into from
Aug 30, 2019
Merged

Conversation

Sija
Copy link
Contributor

@Sija Sija commented Aug 25, 2019

Followup to #520, #538

@Sija Sija force-pushed the cleanup-ameba-warnings branch from a933db4 to cd3124c Compare August 25, 2019 09:40
@@ -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")

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")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #538

Copy link
Member

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 😸

Copy link
Contributor

@veelenga veelenga Sep 1, 2019

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

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?

Copy link
Contributor Author

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.

@Sija Sija force-pushed the cleanup-ameba-warnings branch from cd3124c to e8330ed Compare August 30, 2019 11:23
@Sija
Copy link
Contributor Author

Sija commented Aug 30, 2019

@sdogruyol 🏓

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Sija 👍

@sdogruyol sdogruyol merged commit c893172 into kemalcr:master Aug 30, 2019
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