diff --git a/Library/.rubocop_rules.yml b/Library/.rubocop_rules.yml index 6d14287b6036caf3ee5d96124090fe3b5ead2dcc..915b2e570b1bc0b3df496d081bd310bbfb13f53c 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 3b5a91c5ec5c7da9473cb8323a1981e66e0544ad..0b29efe3023bb1733d672641fc839de0341803f4 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 aa3a49610595b48f65df5c59569706a66f2ffa73..d63f88a1ca7609a00d33dc3fe28b2140e476c290 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 d107d14e8cac96b1b3f9e988d4c3f5dd10186b85..87218fb12bdc8832cfefdc8e4da2f3ed299aa81c 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 0cd2876d0228ebdc926132bdf252361f96ade463..492c09c67a61098db86ff2bc38703f5aa30eb711 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