-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 rubocop violation for fluentd/fluent-plugin-loki #1646
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Follow [the official installation docs](https://github.com/rubygems/bundler#installation-and-usage).
``` lib/fluent/plugin/out_loki.rb:76:21: C: Style/ClassCheck: Prefer Object#is_a? over Object#kind_of?. unless @uri.kind_of?(URI::HTTP) or @uri.kind_of?(URI::HTTPS) ^^^^^^^^ ```
``` lib/fluent/plugin/out_loki.rb:78:9: C: Layout/EmptyLineAfterGuardClause: Add empty line after guard clause. end ```
``` lib/fluent/plugin/out_loki.rb:76:38: C: Style/AndOr: Use || instead of or. unless @uri.is_a?(URI::HTTP) or @uri.is_a?(URI::HTTPS) ^^ ```
``` lib/fluent/plugin/out_loki.rb:77:38: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. raise Fluent::ConfigError, "url parameter must be valid HTTP" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
Both rubocop and rspec fail with the current codes. Except for this rubocop violation, they were fixed. this cyclomatic complexity violation occurrs in configure method. However, it's still simple and the implementation could be changed during spec fixation. So, this violation should be ignored at this moment. ``` lib/fluent/plugin/out_loki.rb:72:7: C: Metrics/CyclomaticComplexity: Cyclomatic complexity for configure is too high. [7/6] def configure(conf) ... ^^^^^^^^^^^^^^^^^^^ ```
Codecov Report
@@ Coverage Diff @@
## master #1646 +/- ##
==========================================
+ Coverage 61.84% 61.89% +0.04%
==========================================
Files 109 109
Lines 8304 8304
==========================================
+ Hits 5136 5140 +4
+ Misses 2774 2772 -2
+ Partials 394 392 -2
|
takanabe
changed the title
Fix rubocop violation
Fix rubocop violation for fluentd/fluent-plugin-loki
Feb 6, 2020
I did a similar cleanup a month ago, the reason why it doesn't stay clean is because we don't have a CI for it and we should but time is hard to find. I really appreciate your time ! Thanks ! |
cyriltovena
approved these changes
Feb 6, 2020
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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
For the maintainability of fluentd output plugin
Which issue(s) this PR fixes:
Fixes #1645
Special notes for your reviewer:
I want to refactor fluentd plugin code through #1645 but it may take time and many contexts. For the first step, I want to fix rubocop violation during
rake spec