Fix Style/NumericLiterals.

This commit is contained in:
Markus Reiter 2016-09-21 09:22:21 +02:00
parent 23dacc7525
commit 9ce3c8d8a4
5 changed files with 8 additions and 17 deletions

View File

@ -11,6 +11,10 @@ Style/StringLiteralsInInterpolation:
Style/NumericLiterals:
MinDigits: 7
# zero-prefixed octal literals are just too widely used (and mostly understood)
Style/NumericLiteralPrefix:
EnforcedOctalStyle: zero_only
# percent-x is allowed for multiline
Style/CommandLiteral:
EnforcedStyle: mixed
@ -62,14 +66,6 @@ Lint/ParenthesesAsGroupedExpression:
Style/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
# port numbers and such tech stuff
Style/NumericLiterals:
Enabled: false
# zero-prefixed octal literals are just too widely used (and mostly understood)
Style/NumericLiteralPrefix:
EnforcedOctalStyle: zero_only
# consistency and readability when faced with string interpolation
Style/PercentLiteralDelimiters:
PreferredDelimiters:

View File

@ -273,11 +273,6 @@ Style/MutableConstant:
- 'Homebrew/tab.rb'
- 'Homebrew/tap.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/NumericLiterals:
MinDigits: 6
# Offense count: 9
Style/OpMethod:
Exclude:

View File

@ -185,8 +185,8 @@ module Homebrew
def puts_result
if ENV["TRAVIS"]
travis_start_time = @start_time.to_i*1000000000
travis_end_time = @end_time.to_i*1000000000
travis_start_time = @start_time.to_i * 1_000_000_000
travis_end_time = @end_time.to_i * 1_000_000_000
travis_duration = travis_end_time - travis_start_time
puts "#{Tty.white}==>#{Tty.green} PASSED#{Tty.reset}" if passed?
puts "travis_time:end:#{@travis_timer_id},start=#{travis_start_time},finish=#{travis_end_time},duration=#{travis_duration}"

View File

@ -118,7 +118,7 @@ class GitDownloadStrategyTests < Homebrew::TestCase
def test_source_modified_time
setup_git_repo
assert_equal 1242860651, @strategy.source_modified_time.to_i
assert_equal 1_242_860_651, @strategy.source_modified_time.to_i
end
def test_last_commit

View File

@ -26,7 +26,7 @@ class PathnameTests < Homebrew::TestCase
mkdir_p @dir/"a-directory"
touch @dir/".DS_Store"
touch @dir/"a-file"
File.truncate(@dir/"a-file", 1048576)
File.truncate(@dir/"a-file", 1_048_576)
ln_s @dir/"a-file", @dir/"a-symlink"
ln @dir/"a-file", @dir/"a-hardlink"
assert_equal 3, @dir.file_count