diff --git a/Library/.rubocop_todo.yml b/Library/.rubocop_todo.yml index feae1d37ba..2f522a8fd6 100644 --- a/Library/.rubocop_todo.yml +++ b/Library/.rubocop_todo.yml @@ -6,16 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect. -# SupportedStyles: keyword, variable, start_of_line -Lint/EndAlignment: - Exclude: - - 'Homebrew/download_strategy.rb' - - 'Homebrew/keg.rb' - - 'Homebrew/os/mac/cctools_mach.rb' - # Offense count: 18 Lint/HandleExceptions: Exclude: diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 99aa2db9a8..0b35e7fb40 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -165,11 +165,11 @@ class DependencyCollector def parse_url_spec(url, tags) case File.extname(url) - when ".xz" then Dependency.new("xz", tags) + when ".xz" then Dependency.new("xz", tags) when ".lha", ".lzh" then Dependency.new("lha", tags) - when ".lz" then Dependency.new("lzip", tags) - when ".rar" then Dependency.new("unrar", tags) - when ".7z" then Dependency.new("p7zip", tags) + when ".lz" then Dependency.new("lzip", tags) + when ".rar" then Dependency.new("unrar", tags) + when ".7z" then Dependency.new("p7zip", tags) end end end diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 048153c16c..2762f01b00 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -696,7 +696,8 @@ class GitDownloadStrategy < VCSDownloadStrategy args << "--depth" << "1" if shallow_clone? case @ref_type - when :branch, :tag then args << "--branch" << @ref + when :branch, :tag + args << "--branch" << @ref end args << @url << cached_location @@ -741,9 +742,11 @@ class GitDownloadStrategy < VCSDownloadStrategy def reset_args ref = case @ref_type - when :branch then "origin/#{@ref}" - when :revision, :tag then @ref - end + when :branch + "origin/#{@ref}" + when :revision, :tag + @ref + end %W[reset --hard #{ref}] end diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index ecbc4c6e00..db3705bc10 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -249,10 +249,10 @@ class Keg def completion_installed?(shell) dir = case shell - when :bash then path.join("etc", "bash_completion.d") - when :zsh then path.join("share", "zsh", "site-functions") - when :fish then path.join("share", "fish", "vendor_completions.d") - end + when :bash then path.join("etc", "bash_completion.d") + when :zsh then path.join("share", "zsh", "site-functions") + when :fish then path.join("share", "fish", "vendor_completions.d") + end dir && dir.directory? && !dir.children.empty? end