Skip to content

Commit

Permalink
Fix brew style
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Sep 14, 2021
1 parent b4a976a commit f61c251
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/extend/ENV/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ def determine_library_paths
rescue FormulaUnavailableError
nil
else
paths << f.opt_lib/"gcc"/f.version.major if f.any_version_installed?
paths << (f.opt_lib/"gcc"/f.version.major) if f.any_version_installed?
end
end

paths << keg_only_deps.map(&:opt_lib)
paths << HOMEBREW_PREFIX/"lib"
paths << (HOMEBREW_PREFIX/"lib")

paths += homebrew_extra_library_paths
PATH.new(paths).existing
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/rubocops/bottle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)

offending_node(hash)
problem "Align bottle tags" do |corrector|
new_line = " " * (max_tag_column - tag_column) + hash.source
new_line = (" " * (max_tag_column - tag_column)) + hash.source
corrector.replace(hash.source_range, new_line)
end
end
Expand Down Expand Up @@ -118,7 +118,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)

offending_node(hash)
problem "Align bottle digests" do |corrector|
new_line = " " * (max_digest_column - digest_column) + hash.source
new_line = (" " * (max_digest_column - digest_column)) + hash.source
corrector.replace(hash.source_range, new_line)
end
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def custom_remote?

# Path to the directory of all {Formula} files for this {Tap}.
def formula_dir
@formula_dir ||= potential_formula_dirs.find(&:directory?) || path/"Formula"
@formula_dir ||= potential_formula_dirs.find(&:directory?) || (path/"Formula")
end

def potential_formula_dirs
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/cleanup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@
it "cleans up VCS checkout directories with modified time < prune time" do
foo = (HOMEBREW_CACHE/"--foo")
foo.mkpath
allow_any_instance_of(Pathname).to receive(:ctime).and_return(Time.now - 2 * 60 * 60 * 24)
allow_any_instance_of(Pathname).to receive(:mtime).and_return(Time.now - 2 * 60 * 60 * 24)
allow_any_instance_of(Pathname).to receive(:ctime).and_return(Time.now - (2 * 60 * 60 * 24))
allow_any_instance_of(Pathname).to receive(:mtime).and_return(Time.now - (2 * 60 * 60 * 24))
described_class.new(days: 1).cleanup_cache
expect(foo).not_to exist
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def columns(*objects, gap_size: 2)
rows = (objects.count + cols - 1) / cols
cols = (objects.count + rows - 1) / rows # avoid empty trailing columns

col_width = (console_width + gap_size) / cols - gap_size
col_width = ((console_width + gap_size) / cols) - gap_size

gap_string = "".rjust(gap_size)

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/repology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def parse_api_response(limit = nil, repository:)
last_package = response.keys.last

page_no += 1
break if limit && outdated_packages.size >= limit || response.size <= 1
break if (limit && outdated_packages.size >= limit) || response.size <= 1
end

puts "#{outdated_packages.size} outdated #{package_term.pluralize(outdated_packages.size)} found"
Expand Down

0 comments on commit f61c251

Please sign in to comment.