aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-21 09:22:21 +0200
committerMarkus Reiter2016-09-23 15:30:06 +0200
commit9ce3c8d8a4059be6187dfcfd3daddfa7ef48c656 (patch)
treec73cab4c22f60b7db167c53b41289a0b2b4f9ce1 /Library
parent23dacc752529bcba88248899cd5b67a66499dc40 (diff)
downloadbrew-9ce3c8d8a4059be6187dfcfd3daddfa7ef48c656.tar.bz2
Fix Style/NumericLiterals.
Diffstat (limited to 'Library')
-rw-r--r--Library/.rubocop_rules.yml12
-rw-r--r--Library/.rubocop_todo.yml5
-rw-r--r--Library/Homebrew/dev-cmd/test-bot.rb4
-rw-r--r--Library/Homebrew/test/test_download_strategies.rb2
-rw-r--r--Library/Homebrew/test/test_pathname.rb2
5 files changed, 8 insertions, 17 deletions
diff --git a/Library/.rubocop_rules.yml b/Library/.rubocop_rules.yml
index 6d14287b6..915b2e570 100644
--- a/Library/.rubocop_rules.yml
+++ b/Library/.rubocop_rules.yml
@@ -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:
diff --git a/Library/.rubocop_todo.yml b/Library/.rubocop_todo.yml
index 3b5a91c5e..0b29efe30 100644
--- a/Library/.rubocop_todo.yml
+++ b/Library/.rubocop_todo.yml
@@ -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:
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb
index aa3a49610..d63f88a1c 100644
--- a/Library/Homebrew/dev-cmd/test-bot.rb
+++ b/Library/Homebrew/dev-cmd/test-bot.rb
@@ -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}"
diff --git a/Library/Homebrew/test/test_download_strategies.rb b/Library/Homebrew/test/test_download_strategies.rb
index d107d14e8..87218fb12 100644
--- a/Library/Homebrew/test/test_download_strategies.rb
+++ b/Library/Homebrew/test/test_download_strategies.rb
@@ -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
diff --git a/Library/Homebrew/test/test_pathname.rb b/Library/Homebrew/test/test_pathname.rb
index 0cd2876d0..492c09c67 100644
--- a/Library/Homebrew/test/test_pathname.rb
+++ b/Library/Homebrew/test/test_pathname.rb
@@ -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