Manual brew style fixes.

This commit is contained in:
Mike McQuaid 2018-11-02 17:27:24 +00:00
parent 737b84b54b
commit 549b02f20a
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
3 changed files with 28 additions and 14 deletions

View File

@ -327,7 +327,7 @@ class Formula
active_spec == head
end
delegate [
delegate [ # rubocop:disable Layout/AlignHash
:bottle_unneeded?,
:bottle_disabled?,
:bottle_disable_reason,
@ -335,7 +335,7 @@ class Formula
:bottled?,
:bottle_specification,
:downloader,
] => :active_spec
] => :active_spec
# The Bottle object for the currently active {SoftwareSpec}.
# @private
@ -1615,10 +1615,20 @@ class Formula
"bottle" => {},
"keg_only" => keg_only?,
"options" => [],
"build_dependencies" => dependencies.select(&:build?).map(&:name).uniq,
"dependencies" => dependencies.reject(&:optional?).reject(&:recommended?).reject(&:build?).map(&:name).uniq,
"recommended_dependencies" => dependencies.select(&:recommended?).map(&:name).uniq,
"optional_dependencies" => dependencies.select(&:optional?).map(&:name).uniq,
"build_dependencies" => dependencies.select(&:build?)
.map(&:name)
.uniq,
"dependencies" => dependencies.reject(&:optional?)
.reject(&:recommended?)
.reject(&:build?)
.map(&:name)
.uniq,
"recommended_dependencies" => dependencies.select(&:recommended?)
.map(&:name)
.uniq,
"optional_dependencies" => dependencies.select(&:optional?)
.map(&:name)
.uniq,
"requirements" => [],
"conflicts_with" => conflicts.map(&:name),
"caveats" => caveats,
@ -1641,9 +1651,10 @@ class Formula
}
bottle_info["files"] = {}
bottle_spec.collector.keys.each do |os|
bottle_url = "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}"
checksum = bottle_spec.collector[os]
bottle_info["files"][os] = {
"url" => "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}",
"url" => bottle_url,
checksum.hash_type.to_s => checksum.hexdigest,
}
end

View File

@ -104,8 +104,10 @@ module Homebrew
end
end
HOMEBREW_PULL_API_REGEX = %r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze
HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze
HOMEBREW_PULL_API_REGEX =
%r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze
HOMEBREW_PULL_OR_COMMIT_URL_REGEX =
%r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze
require "forwardable"
require "PATH"

View File

@ -32,11 +32,12 @@ describe RuboCop::Cop::FormulaAudit::Homepage do
end
RUBY
expected_offenses = [{ message: "The homepage should start with http or https (URL is ftp://example.com/foo).",
severity: :convention,
line: 2,
column: 2,
source: source }]
expected_offenses = [{ message: "The homepage should start with http or " \
"https (URL is ftp://example.com/foo).",
severity: :convention,
line: 2,
column: 2,
source: source }]
inspect_source(source)