Skip to content

Commit

Permalink
Rubocop: fix three cops in examples/ucfinfo.
Browse files Browse the repository at this point in the history
* Layout/MultilineOperationIndentation
* Style/FormatString
* Style/FormatStringToken
  • Loading branch information
hainesr committed Apr 30, 2023
1 parent 037c65d commit 0e13469
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
23 changes: 0 additions & 23 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/MultilineOperationIndentation:
Exclude:
- 'examples/ucfinfo'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: format, sprintf, percent
Style/FormatString:
Exclude:
- 'examples/ucfinfo'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
EnforcedStyle: unannotated

# Offense count: 17
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
Expand Down
6 changes: 4 additions & 2 deletions examples/ucfinfo
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,7 @@ ucf.each do |entry|
end

ratio = ((total_size - total_comp) / total_size.to_f) * 100
puts '%d files, %d bytes uncompressed, %d bytes compressed: %.1f%%' %
[ucf.size, total_size, total_comp, ratio]
puts format(
'%<num>d files, %<size>d bytes uncompressed, %<comp>d bytes compressed: %<ratio>.1f%%',
{ num: ucf.size, size: total_size, comp: total_comp, ratio: ratio }
)

0 comments on commit 0e13469

Please sign in to comment.