Skip to content

Commit b69cea5

Browse files
authored
Rubocop: Fix Bundler/OrderedGems and Performance/FluentdPluginLogStringInterpolation (#5)
This patch will fix following Rubocop's suggestions: ``` $ bundle exec rubocop Inspecting 5 files C...C Offenses: Gemfile:8:1: C: [Correctable] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem rubocop-fluentd should appear before test-unit. gem "test-unit-rr", "~> 1.0.5" ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Gemfile:9:1: C: [Correctable] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem rubocop-fluentd should appear before test-unit-rr. gem "rubocop-fluentd", "~> 0.2.0" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/fluent/plugin/in_fluent_package_update_notifier.rb:75:11: C: Performance/FluentdPluginLogStringInterpolation: Use log.error { "..." } instead of log.error("...") log.error "Failed to check updates: #{e.message}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 5 files inspected, 3 offenses detected, 2 offenses autocorrectable ```
1 parent 24156be commit b69cea5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ gemspec
44

55
gem "bundler", "~> 2.4"
66
gem "rake", "~> 13.2.1"
7+
gem "rubocop-fluentd", "~> 0.2.0"
78
gem "test-unit", "~> 3.0"
89
gem "test-unit-rr", "~> 1.0.5"
9-
gem "rubocop-fluentd", "~> 0.2.0"

lib/fluent/plugin/in_fluent_package_update_notifier.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def check_fluent_pacakge_update_information
7272
checker = Fluent::Plugin::FluentPackage::UpdateChecker.new(options)
7373
checker.run
7474
rescue => e
75-
log.error "Failed to check updates: #{e.message}"
75+
log.error { "Failed to check updates: #{e.message}" }
7676
end
7777
end
7878
end

0 commit comments

Comments
 (0)