diff --git a/.rubocop.yml b/.rubocop.yml index d1b1b7baf..dc3ef6fc0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -941,7 +941,7 @@ Style/For: Enabled: true Style/FormatString: - Enabled: false + Enabled: true Style/FormatStringToken: Enabled: true diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 2f6b5b3a8..d37af55f4 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -93,7 +93,7 @@ class StatsController < ApplicationController else evolution = 0 end - formatted_evolution = sprintf("%+d", evolution) + formatted_evolution = format("%+d", evolution) { total: total.to_s, @@ -111,7 +111,7 @@ class StatsController < ApplicationController else evolution = 0 end - formatted_evolution = sprintf("%+d", evolution) + formatted_evolution = format("%+d", evolution) { total: total.to_s, diff --git a/lib/tasks/task_helper.rb b/lib/tasks/task_helper.rb index 04ef5d32b..7443af5ff 100644 --- a/lib/tasks/task_helper.rb +++ b/lib/tasks/task_helper.rb @@ -52,7 +52,7 @@ class ProgressReport def print_progress elapsed = Time.zone.now - @start - percent = sprintf('%5.1f%%', @per_10_000 / 100.0) + percent = format('%5.1f%%', @per_10_000 / 100.0) total = @total.to_s count = @count.to_s.rjust(total.length) rake_print("\r#{percent} (#{count}/#{total}) [#{format_duration(elapsed)}/#{format_duration(elapsed * 10_000.0 / @per_10_000)}]")