diff --git a/Library/.rubocop_rules.yml b/Library/.rubocop_rules.yml index 6d14287b60..915b2e570b 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 3b5a91c5ec..0b29efe302 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 aa3a496105..d63f88a1ca 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 d107d14e8c..87218fb12b 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 0cd2876d02..492c09c67a 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