Enable the Style/FormatString cop

This commit is contained in:
gregoirenovel 2018-12-18 21:55:45 +01:00
parent 621154fde4
commit a8f700b572
3 changed files with 4 additions and 4 deletions

View file

@ -941,7 +941,7 @@ Style/For:
Enabled: true Enabled: true
Style/FormatString: Style/FormatString:
Enabled: false Enabled: true
Style/FormatStringToken: Style/FormatStringToken:
Enabled: true Enabled: true

View file

@ -93,7 +93,7 @@ class StatsController < ApplicationController
else else
evolution = 0 evolution = 0
end end
formatted_evolution = sprintf("%+d", evolution) formatted_evolution = format("%+d", evolution)
{ {
total: total.to_s, total: total.to_s,
@ -111,7 +111,7 @@ class StatsController < ApplicationController
else else
evolution = 0 evolution = 0
end end
formatted_evolution = sprintf("%+d", evolution) formatted_evolution = format("%+d", evolution)
{ {
total: total.to_s, total: total.to_s,

View file

@ -52,7 +52,7 @@ class ProgressReport
def print_progress def print_progress
elapsed = Time.zone.now - @start 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 total = @total.to_s
count = @count.to_s.rjust(total.length) 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)}]") rake_print("\r#{percent} (#{count}/#{total}) [#{format_duration(elapsed)}/#{format_duration(elapsed * 10_000.0 / @per_10_000)}]")