Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rubocop violation for fluentd/fluent-plugin-loki (grafana#1646)
* Don't use sudo to install bundler Follow [the official installation docs](https://github.com/rubygems/bundler#installation-and-usage). * Fix rubocop viloation: kind_of? -> is_a? ``` 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) ^^^^^^^^ ``` * Fix rubocop violation ``` lib/fluent/plugin/out_loki.rb:78:9: C: Layout/EmptyLineAfterGuardClause: Add empty line after guard clause. end ``` * Fix rubocup violation: or -> || ``` 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) ^^ ``` * Fix rubocop violation: use single quoate ``` 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" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` * Ignore rubocop violation: configure method is still not complex 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) ... ^^^^^^^^^^^^^^^^^^^ ```
- Loading branch information