Skip to content

Commit

Permalink
Rubocop fixed: Style/FormatString
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jun 24, 2015
1 parent 0c0f576 commit 69143e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .rubocop.yml
Expand Up @@ -64,11 +64,6 @@ Style/FileName:
- tests/ycp/InRuby.rb
- tests/ycp/URI.rb

# Offense count: 3
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/FormatString:
Enabled: false

# Offense count: 3
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Expand Down
6 changes: 3 additions & 3 deletions src/ruby/yast/builtins.rb
Expand Up @@ -856,14 +856,14 @@ def self.tohexstring(int, width = 0)
return nil if int.nil? || width.nil?

if int >= 0
sprintf("0x%0#{width}x", int)
format("0x%0#{width}x", int)
else
# compatibility for negative numbers
# Ruby: -3 => '0x..fd'
# Yast: -3 => '0xfffffffffffffffd' (64bit integer)

# this has '..fff' prefix
ret = sprintf("%018x", int)
ret = format("%018x", int)

# pad with zeroes or spaces if needed
if width > 16
Expand Down Expand Up @@ -892,7 +892,7 @@ def self.tostring(val, width = nil)
if width
raise "tostring: negative 'width' argument: #{width}" if width < 0

return "%.#{width}f" % val
return format("%.#{width}f", val)
end

case val
Expand Down

0 comments on commit 69143e5

Please sign in to comment.