language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | Homebrew | brew | 03ace9b1104f1ddc2adc75a68531167d7e3ea7e0.json | Require more HTTP mirrors for old OS X versions.
This allows the bootstrap of `curl` and `git` on versions of Mac OS X
that cannot reliably download from HTTPS servers any longer. Once these
are both installed users are able to update Homebrew and download files
securely.
Also, as we're doing this, don't point 10.5 u... | docs/Installation.md | @@ -47,7 +47,7 @@ PowerPC and Tiger branches from other users in the fork network. See
[Interesting Taps and Forks](Interesting-Taps-and-Forks.md).
<a name="2"><sup>2</sup></a> 10.10 or higher is recommended. 10.5–10.9 are
-supported on a best-effort basis. For 10.4 and 10.5, see
+supported on a best-effort basis. ... | true |
Other | Homebrew | brew | 049a453b460a5580991e5ca0f8c77fcd1f86eea1.json | linkage_checker: avoid some false positives | Library/Homebrew/os/mac/linkage_checker.rb | @@ -80,7 +80,7 @@ def check_undeclared_deps
end
extraneous_deps = declared_dep_names.reject do |full_name|
name = full_name.split("/").last
- @brewed_dylibs.keys.map { |x| x.split("/").last }.include? name
+ Formula[name].bin.directory? || @brewed_dylibs.keys.map { |x| x.split("/").last }.inc... | false |
Other | Homebrew | brew | 732bf2212d1d52e4f14bef82df94ba4ed537b5fb.json | build: fix HOMEBREW_FORMULA_PREFIX for head
so that it includes the commit. | Library/Homebrew/build.rb | @@ -112,6 +112,10 @@ def install
formula.extend(Debrew::Formula) if ARGV.debug?
formula.brew do |_formula, staging|
+ # For head builds, HOMEBREW_FORMULA_PREFIX should include the commit,
+ # which is not known until after the formula has been staged.
+ ENV["HOMEBREW_FORMULA_PREFIX"... | false |
Other | Homebrew | brew | 49d2d7b94d85dd150956ea14d66a34870d2f70fd.json | home_spec: use different test formula.
Instead of `testball` use a formula named `testballhome` to avoid this
clashing with any other formula named testball. | Library/Homebrew/test/cmd/home_spec.rb | @@ -7,10 +7,10 @@
end
it "opens the homepage for a given Formula" do
- setup_test_formula "testball"
+ setup_test_formula "testballhome"
- expect { brew "home", "testball", "HOMEBREW_BROWSER" => "echo" }
- .to output("#{Formula["testball"].homepage}\n").to_stdout
+ expect { brew "home", "test... | false |
Other | Homebrew | brew | a6d1ddf32611109b3284b045fdc5123c40e23b9e.json | git_spec.rb: use HTTPS for Git remote test | Library/Homebrew/test/utils/git_spec.rb | @@ -130,7 +130,7 @@
context "when git is available" do
it "returns true when git remote exists", :needs_network do
git = HOMEBREW_SHIMS_PATH/"scm/git"
- url = "http://github.com/Homebrew/homebrew.github.io"
+ url = "https://github.com/Homebrew/homebrew.github.io"
repo = HOMEB... | false |
Other | Homebrew | brew | 01872506000619bd57b48e5b69593b5d42ded29e.json | travis.yml: fix umask for brew audit.
Change the umask before we create any files to avoid `brew audit`
complaining about the `chmod` of formulae. | .travis.yml | @@ -20,21 +20,22 @@ matrix:
before_install:
- export HOMEBREW_NO_AUTO_UPDATE=1
- export HOMEBREW_DEVELOPER=1
- - git clone --depth=1 https://github.com/Homebrew/homebrew-test-bot Library/Taps/homebrew/homebrew-test-bot
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+ git clone --depth=1 https://github.com/H... | false |
Other | Homebrew | brew | d45ff9c0fdfa834c55c01f9c95fe18064fabd76a.json | audit: Add a global flag to silent warning when auditing | Library/Homebrew/dev-cmd/audit.rb | @@ -54,6 +54,7 @@ module Homebrew
def audit
Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D"
+ Homebrew.auditing = true
formula_count = 0
problem_count = 0 | true |
Other | Homebrew | brew | d45ff9c0fdfa834c55c01f9c95fe18064fabd76a.json | audit: Add a global flag to silent warning when auditing | Library/Homebrew/global.rb | @@ -45,11 +45,15 @@ def failed?
@failed == true
end
- attr_writer :raise_deprecation_exceptions
+ attr_writer :raise_deprecation_exceptions, :auditing
def raise_deprecation_exceptions?
@raise_deprecation_exceptions == true
end
+
+ def auditing?
+ @auditing == true
+ end... | true |
Other | Homebrew | brew | d45ff9c0fdfa834c55c01f9c95fe18064fabd76a.json | audit: Add a global flag to silent warning when auditing | Library/Homebrew/utils.rb | @@ -102,7 +102,7 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call
if ARGV.homebrew_developer? || disable ||
Homebrew.raise_deprecation_exceptions?
raise MethodDeprecatedError, message
- else
+ elsif !Homebrew.auditing?
opoo "#{message}\n"
end
end | true |
Other | Homebrew | brew | b582ed513b3b28197369cb3cf808e9c4025ee581.json | audit: Add tests for rubocop methods in line_cop.rb | Library/Homebrew/rubocops/extend/formula_cop.rb | @@ -108,6 +108,8 @@ def find_method_with_args(node, method_name, *args)
# Matches a method with a receiver,
# EX: to match `Formula.factory(name)`
# call `find_instance_method_call(node, "Formula", :factory)`
+ # EX: to match `build.head?`
+ # call `find_instance_method_call(node, :build,... | true |
Other | Homebrew | brew | b582ed513b3b28197369cb3cf808e9c4025ee581.json | audit: Add tests for rubocop methods in line_cop.rb | Library/Homebrew/rubocops/lines_cop.rb | @@ -129,7 +129,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end
# Node Pattern search for Language::Node
- def_node_search :languageNodeModule?, <<-EOS.undent
+ def_node_search :languageNodeModule?, <<-EOS.undent
(const (const nil :Language) :No... | true |
Other | Homebrew | brew | b582ed513b3b28197369cb3cf808e9c4025ee581.json | audit: Add tests for rubocop methods in line_cop.rb | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -200,5 +200,276 @@ class Foo < Formula
expect_offense(expected, actual)
end
end
+
+ it "with invalid rebuild" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ bottle do
+ rebuild 0
+ ... | true |
Other | Homebrew | brew | 6e3acddc44379eb5d13c923ec08d2f51f0475af9.json | docs: Clarify availability of analytics
This commit tweaks the language in Analytics.md to make it clear
that summaries of install/error data are publicly available,
while only Homebrew maintainers can access the full analytics
(as specified above in the document). | docs/Analytics.md | @@ -37,7 +37,9 @@ As far as we can tell it would be impossible for Google to match the randomly ge
Homebrew's analytics are sent throughout Homebrew's execution to Google Analytics over HTTPS.
## Who?
-Homebrew's analytics are accessible to Homebrew's current maintainers. Contact @MikeMcQuaid if you are a maintaine... | false |
Other | Homebrew | brew | bbf71921eb2b2cce5072bb615fac3a2bc96fcfc7.json | audit: fix subversion remote check logic.
Stop flagging invalid URLs as valid and vice-versa.
Fixes #3118. | Library/Homebrew/dev-cmd/audit.rb | @@ -1233,7 +1233,7 @@ def audit_urls
elsif strategy <= SubversionDownloadStrategy
next unless DevelopmentTools.subversion_handles_most_https_certificates?
next unless Utils.svn_available?
- if Utils.svn_remote_exists url
+ unless Utils.svn_remote_exists url
problem "The... | false |
Other | Homebrew | brew | 6d726e1bd6676d97bf41bc800942881cf8c3e78f.json | gpg: create unified test helper | Library/Homebrew/gpg.rb | @@ -54,4 +54,13 @@ def self.cleanup_test_processes!
system gpgconf, "--homedir", "keyrings/live", "--kill",
"gpg-agent"
end
+
+ def self.test(path)
+ create_test_key(path)
+ begin
+ yield
+ ensure
+ cleanup_test_processes!
+ end
+ end
end | false |
Other | Homebrew | brew | c75a8221a5115dc45634ece380266a8a63c0458d.json | gpg2_requirement: update code comments | Library/Homebrew/requirements/gpg2_requirement.rb | @@ -5,8 +5,8 @@ class GPG2Requirement < Requirement
fatal true
default_formula "gnupg"
- # GPGTools installs GnuPG 2.0.x as a vanilla `gpg` symlink
- # pointing to `gpg2`. Homebrew install 2.1.x as a non-symlink `gpg`.
- # We support both the 2.0.x "stable" and 2.1.x "modern" series here.
+ # GPGTools insta... | false |
Other | Homebrew | brew | f301e5c4f4a3094aa9a1a1cf76a34efbd04b838d.json | audit: add a nudge to remove ENV.java_cache | Library/Homebrew/dev-cmd/audit.rb | @@ -869,6 +869,10 @@ def line_problems(line, _lineno)
problem "Use \"depends_on :x11\" instead of \"ENV.x11\""
end
+ if line.include?("ENV.java_cache")
+ problem "In-formula ENV.java_cache usage has been deprecated & should be removed."
+ end
+
# Avoid hard-coding compilers
if line =~... | false |
Other | Homebrew | brew | 775245262d02017cbc10cf842f7a09fd464d30a4.json | add zsh completion for switch <formula> <version> | completions/zsh/_brew | @@ -592,8 +592,14 @@ _brew_style() {
# brew switch name version:
_brew_switch() {
- _message "name version"
- return 1
+ local -a versions
+ if [[ -n ${words[2]} ]]; then
+ versions=(${$(brew ls "${words[2]}" --versions)#${words[2]}})
+ fi
+ _arguments -S \
+ '1::formula:__brew_formulae' \
+ "2:: :($... | false |
Other | Homebrew | brew | 4cfd333c5a9fd32f1d9870b3e4987c7dad76a88a.json | pour_bottle?: Pour local bottles without sha256
Pouring a local bottle for a formula without a bottle sha256
in the formula for that OS would unexpectedly install from
source instead. | Library/Homebrew/formula_installer.rb | @@ -85,7 +85,7 @@ def pour_bottle?(install_bottle_options = { warn: false })
return false if @pour_failed
bottle = formula.bottle
- return false unless bottle
+ return false if !bottle && !formula.local_bottle_path
return true if force_bottle?
return false if build_from_source? || build_bot... | false |
Other | Homebrew | brew | 56ccf10efaac5f97bae6b2e5aef9ef87d7529328.json | limit some heuristics to strict mode | Library/Homebrew/dev-cmd/audit.rb | @@ -201,7 +201,7 @@ def initialize(formula, options = {})
@specs = %w[stable devel head].map { |s| formula.send(s) }.compact
end
- def self.check_http_content(url, name, user_agents: [:default], check_content: false)
+ def self.check_http_content(url, name, user_agents: [:default], check_content: false, str... | false |
Other | Homebrew | brew | f8d5b20512700c9458c51523bda2da24f4212b0c.json | missing_formula: use pip2 instead of pip | Library/Homebrew/missing_formula.rb | @@ -31,7 +31,7 @@ def blacklisted_reason(name)
#{Formatter.url("https://pip.readthedocs.io/en/stable/installing/")}
EOS
when "pil" then <<-EOS.undent
- Instead of PIL, consider `pip install pillow`.
+ Instead of PIL, consider `pip2 install pillow`.
EOS
... | false |
Other | Homebrew | brew | 923c84d4f7c4e0cf09bfb417deb83bff2364c199.json | add some heuristics to https upgrade check | Library/Homebrew/dev-cmd/audit.rb | @@ -201,7 +201,7 @@ def initialize(formula, options = {})
@specs = %w[stable devel head].map { |s| formula.send(s) }.compact
end
- def self.check_http_content(url, name, user_agents: [:default])
+ def self.check_http_content(type, url, name, user_agents: [:default])
return unless url.start_with? "http"... | false |
Other | Homebrew | brew | abe47b79c898c49d762df5d0f52541722e8e202c.json | Add check for HEAD ref in diagnostics | Library/Homebrew/diagnostic.rb | @@ -756,7 +756,7 @@ def check_brew_git_origin
end
end
- def check_coretap_git_origin
+ def check_coretap_git_config
coretap_path = CoreTap.instance.path
return if !Utils.git_available? || !(coretap_path/".git").exist?
@@ -785,6 +785,22 @@ def check_coretap_git_origin
... | false |
Other | Homebrew | brew | 7b96fd008e332949b9d53ffe08e9de20dbff0e2d.json | safe_fork: Improve the error message | Library/Homebrew/utils/fork.rb | @@ -38,7 +38,7 @@ def self.safe_fork(&_block)
Process.wait(pid) unless socket.nil?
raise Marshal.load(data) unless data.nil? || data.empty?
raise Interrupt if $CHILD_STATUS.exitstatus == 130
- raise "Suspicious failure" unless $CHILD_STATUS.success?
+ raise "Forked chi... | false |
Other | Homebrew | brew | 00eb4324de2035e417344b7b7a2cac6e5a8f29a5.json | Update FAQ entry | docs/FAQ.md | @@ -68,13 +68,15 @@ Be careful as this is a destructive operation.
Which is usually: `~/Library/Caches/Homebrew`
## My Mac `.app`s don’t find `/usr/local/bin` utilities!
-GUI apps on macOS don’t have `/usr/local/bin` in their `PATH` by default.
-If you’re on Mountain Lion, you can fix this by running
-`launchctl se... | false |
Other | Homebrew | brew | b44c7a1022976a4fcd9e7ea9b6069ec971d6b235.json | upgrade more urls to https | Library/Homebrew/cmd/search.rb | @@ -36,7 +36,7 @@ def search
elsif ARGV.include? "--fedora"
exec_browser "https://apps.fedoraproject.org/packages/s/#{ARGV.next}"
elsif ARGV.include? "--ubuntu"
- exec_browser "http://packages.ubuntu.com/search?keywords=#{ARGV.next}&searchon=names&suite=all§ion=all"
+ exec_browser "https:... | true |
Other | Homebrew | brew | b44c7a1022976a4fcd9e7ea9b6069ec971d6b235.json | upgrade more urls to https | Library/Homebrew/extend/fileutils.rb | @@ -3,7 +3,7 @@
require "etc"
# Homebrew extends Ruby's `FileUtils` to make our code more readable.
-# @see http://ruby-doc.org/stdlib-2.0.0/libdoc/fileutils/rdoc/FileUtils.html Ruby's FileUtils API
+# @see https://ruby-doc.org/stdlib-2.0.0/libdoc/fileutils/rdoc/FileUtils.html Ruby's FileUtils API
module FileUtils... | true |
Other | Homebrew | brew | b44c7a1022976a4fcd9e7ea9b6069ec971d6b235.json | upgrade more urls to https | Library/Homebrew/extend/pathname.rb | @@ -59,7 +59,7 @@ def compute_disk_usage
end
# Homebrew extends Ruby's `Pathname` to make our code more readable.
-# @see http://ruby-doc.org/stdlib-1.8.7/libdoc/pathname/rdoc/Pathname.html Ruby's Pathname API
+# @see https://ruby-doc.org/stdlib-1.8.7/libdoc/pathname/rdoc/Pathname.html Ruby's Pathname API
class ... | true |
Other | Homebrew | brew | b44c7a1022976a4fcd9e7ea9b6069ec971d6b235.json | upgrade more urls to https | Library/Homebrew/test/cmd/search_spec.rb | @@ -53,7 +53,7 @@
"debian" => "https://packages.debian.org/search?keywords=testball&searchon=names&suite=all§ion=all",
"opensuse" => "https://software.opensuse.org/search?q=testball",
"fedora" => "https://apps.fedoraproject.org/packages/s/testball",
- "ubuntu" => "http://packages.ubuntu.com/search... | true |
Other | Homebrew | brew | b44c7a1022976a4fcd9e7ea9b6069ec971d6b235.json | upgrade more urls to https | docs/Formula-Cookbook.md | @@ -693,7 +693,7 @@ Note that [`option`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula
### File level operations
-You can use the file utilities provided by Ruby's [`FileUtils`](http://www.ruby-doc.org/stdlib/libdoc/fileutils/rdoc/index.html). These are included in the `Formula` class, so you do not ... | true |
Other | Homebrew | brew | b44c7a1022976a4fcd9e7ea9b6069ec971d6b235.json | upgrade more urls to https | docs/Prose-Style-Guidelines.md | @@ -16,7 +16,7 @@ Homebrew's audience includes users with a wide range of education and experience
We strive for "correct" but not "fancy" usage. Think newspaper article, not academic paper.
-This is a set of guidelines to be applied using human judgment, not a set of hard and fast rules. It is like [The Economist... | true |
Other | Homebrew | brew | 56ef168e7088962ba7b1cdc3da89d30842a8eb69.json | Move fix from #3070 inside `GitHub` module. | Library/Homebrew/cask/lib/hbc/cli/search.rb | @@ -15,7 +15,6 @@ def self.extract_regexp(string)
end
def self.search_remote(query)
- return [] if ENV["HOMEBREW_NO_GITHUB_API"]
matches = GitHub.search_code(user: "caskroom", path: "Casks",
filename: query, extension: "rb")
matches.map do |... | true |
Other | Homebrew | brew | 56ef168e7088962ba7b1cdc3da89d30842a8eb69.json | Move fix from #3070 inside `GitHub` module. | Library/Homebrew/utils/github.rb | @@ -133,7 +133,7 @@ def api_credentials_error_message(response_headers, needed_scopes)
def open(url, data: nil, scopes: [].freeze)
# This is a no-op if the user is opting out of using the GitHub API.
- return if ENV["HOMEBREW_NO_GITHUB_API"]
+ return block_given? ? yield({}) : {} if ENV["HOMEBREW_NO_GIT... | true |
Other | Homebrew | brew | 564a06dfbb711a995558c64c55b353d1fdfcb473.json | Fix typo in spec | Library/Homebrew/test/utils/github_spec.rb | @@ -32,7 +32,7 @@
describe "::search_issues", :needs_network do
it "queries GitHub issues with the passed parameters" do
results = subject.search_issues("brew search", repo: "Homebrew/brew", author: "avetamine", is: "closed")
- expect(results.count).not_to be_empty
+ expect(results).not_to be_e... | false |
Other | Homebrew | brew | e096836b7b46e605fb4d1c10c632157dd6b11186.json | Improve rspec readability | Library/Homebrew/test/utils/github_spec.rb | @@ -32,7 +32,7 @@
describe "::search_issues", :needs_network do
it "queries GitHub issues with the passed parameters" do
results = subject.search_issues("brew search", repo: "Homebrew/brew", author: "avetamine", is: "closed")
- expect(results.count).to be > 1
+ expect(results.count).not_to be_e... | false |
Other | Homebrew | brew | afdd0e2437426ec85ff86e5b7562d3a6a69ba3e5.json | add tests for condition dependencies | Library/Homebrew/rubocops/lines_cop.rb | @@ -181,27 +181,22 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use MacOS.full_version instead of MACOS_FULL_VERSION"
end
- # dependency(body_node) do |m|
- # # handle symbols and shit: WIP
- # next unless modifier?(m.parent)
-... | true |
Other | Homebrew | brew | afdd0e2437426ec85ff86e5b7562d3a6a69ba3e5.json | add tests for condition dependencies | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1213,6 +1213,72 @@ class Foo < Formula
end
end
+ it "with if conditional dep" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ depends_on "foo" if build.with? "with-foo"
+ end
+ EOS
+
+ ex... | true |
Other | Homebrew | brew | efabd4b5c2beadecf3282dbe730b1b6f779571e0.json | Add tests for MACOS version consts usage | Library/Homebrew/rubocops/extend/formula_cop.rb | @@ -173,8 +173,8 @@ def depends_on_name_type?(node, name = nil, type = :required)
# if block given, yield matching nodes
def find_const(node, const_name)
return if node.nil?
- node.each_child_node(:const) do |const_node|
- next if const_node.const_name != const_name
+ node.... | true |
Other | Homebrew | brew | efabd4b5c2beadecf3282dbe730b1b6f779571e0.json | Add tests for MACOS version consts usage | Library/Homebrew/rubocops/lines_cop.rb | @@ -173,14 +173,14 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use \"if build.#{match[1].downcase}?\" instead"
end
- # find_const(body_node, :MACOS_VERSION) do
- # problem "Use MacOS.version instead of MACOS_VERSION"
- # end
- ... | true |
Other | Homebrew | brew | efabd4b5c2beadecf3282dbe730b1b6f779571e0.json | Add tests for MACOS version consts usage | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1189,6 +1189,30 @@ class Foo < Formula
end
end
+ it "with MACOS_VERSION const" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ test do
+ version = MACOS_VERSION
+ end
+ end
+ ... | true |
Other | Homebrew | brew | 2f94d5f499bca6bbab238bb6536f05195b358159.json | add test for ARGV.include? | Library/Homebrew/rubocops/lines_cop.rb | @@ -167,12 +167,12 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use `depends_on :fortran` instead of `ENV.fortran`"
end
- # find_instance_method_call(body_node, :ARGV, :include?) do |m|
- # param = parameters(m).first
- # next ... | true |
Other | Homebrew | brew | 2f94d5f499bca6bbab238bb6536f05195b358159.json | add test for ARGV.include? | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1165,6 +1165,30 @@ class Foo < Formula
end
end
+ it "with ARGV.include? (--HEAD)" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ test do
+ head = ARGV.include? "--HEAD"
+ end
+ ... | true |
Other | Homebrew | brew | 3fc6cc1a3a4b8f1b7ca42dc0a7dd7cf8fad91b18.json | add test for ENV.fortran | Library/Homebrew/rubocops/lines_cop.rb | @@ -162,11 +162,11 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use 'build.head?' instead of inspecting 'version'"
end
- # find_instance_method_call(body_node, :ENV, :fortran) do
- # next if depends_on?(:fortran)
- # problem "U... | true |
Other | Homebrew | brew | 3fc6cc1a3a4b8f1b7ca42dc0a7dd7cf8fad91b18.json | add test for ENV.fortran | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1141,6 +1141,30 @@ class Foo < Formula
end
end
+ it "with ENV.fortran" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ test do
+ ENV.fortran
+ end
+ end
+ EOS
+
+ expe... | true |
Other | Homebrew | brew | 5744cd9066bbdfc4db5332a202ddb962d5359ee5.json | add test for inspecting version | Library/Homebrew/rubocops/lines_cop.rb | @@ -157,11 +157,11 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Dependency #{string_content(dep)} should not use option #{string_content(option)}"
end
- # find_instance_method_call(body_node, :version, :==) do |m|
- # next unless paramete... | true |
Other | Homebrew | brew | 5744cd9066bbdfc4db5332a202ddb962d5359ee5.json | add test for inspecting version | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1117,6 +1117,30 @@ class Foo < Formula
end
end
+ it "with inspecting version" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ if version == "HEAD"
+ foo()
+ end
+ end
+ EOS... | true |
Other | Homebrew | brew | cfc423e1839442f605072db14aac42f6f5fa6174.json | add tests for dependencies | Library/Homebrew/rubocops/lines_cop.rb | @@ -148,13 +148,15 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use ENV instead of invoking '#{match[1]}' to modify the environment"
end
- # find_every_method_call_by_name(body_node, :depends_on).each do |m|
- # next unless modifier?(m)
-... | true |
Other | Homebrew | brew | cfc423e1839442f605072db14aac42f6f5fa6174.json | add tests for dependencies | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1095,6 +1095,28 @@ class Foo < Formula
end
end
+ it "with dependencies with invalid options" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ depends_on "foo" => "with-bar"
+ end
+ EOS
+
+ ... | true |
Other | Homebrew | brew | d2a7314f538f919e9b09e4b27c1f86b7d3d2eda2.json | add test for env mod through system call | Library/Homebrew/rubocops/lines_cop.rb | @@ -135,18 +135,19 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "\"\#\{prefix}#{match[1]}\" should be \"\#{#{match[2].downcase}}\""
end
end
+
find_every_method_call_by_name(body_node, :depends_on).each do |m|
key, value = ... | true |
Other | Homebrew | brew | d2a7314f538f919e9b09e4b27c1f86b7d3d2eda2.json | add test for env mod through system call | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1073,6 +1073,28 @@ class Foo < Formula
end
end
+ it "with setting env manually" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ system "export", "var=value"
+ end
+ EOS
+
+ expected_offen... | true |
Other | Homebrew | brew | 64a929184a45f530a49af7b047d5b6605b50b1f8.json | add tests for vendored deps | Library/Homebrew/rubocops/lines_cop.rb | @@ -135,14 +135,13 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "\"\#\{prefix}#{match[1]}\" should be \"\#{#{match[2].downcase}}\""
end
end
+ find_every_method_call_by_name(body_node, :depends_on).each do |m|
+ key, value = de... | true |
Other | Homebrew | brew | 64a929184a45f530a49af7b047d5b6605b50b1f8.json | add tests for vendored deps | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -1051,6 +1051,28 @@ def install
end
end
+ it "with dependecies which have to vendored" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ depends_on "lpeg" => :lua51
+ end
+ EOS
+
+ expected_... | true |
Other | Homebrew | brew | 063cbe7acdb0af0a4cd9bd35f29f89bc0d638d4a.json | add tests for formula path shortucut 3 | Library/Homebrew/rubocops/lines_cop.rb | @@ -124,15 +124,15 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "\"\#\{share}#{match[1]}\" should be \"\#{#{match[2]}}\""
end
- formula_path_strings(body_node, :share) do |p|
- if match = regex_match_group(p, %r{/(bin|include|libexec|lib|s... | true |
Other | Homebrew | brew | 063cbe7acdb0af0a4cd9bd35f29f89bc0d638d4a.json | add tests for formula path shortucut 3 | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -979,6 +979,78 @@ def install
expect_offense(expected, actual)
end
end
+
+ it "with formula path shortcut long form 1" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def install
+ mv "\#... | true |
Other | Homebrew | brew | 9c9c280c8aeb97a6ec8956242727208d80247826.json | add tests for formula path string 1 | Library/Homebrew/rubocops/lines_cop.rb | @@ -118,24 +118,24 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end
end
- # # Prefer formula path shortcuts in strings
- # formula_path_strings(body_node, :prefix) do |p|
- # next unless match = regex_match_group(p, %r{(/(man))[/'"]})
- ... | true |
Other | Homebrew | brew | 9c9c280c8aeb97a6ec8956242727208d80247826.json | add tests for formula path string 1 | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -955,6 +955,30 @@ def install
expect_offense(expected, actual)
end
end
+
+ it "with formula path shortcut long form" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def install
+ mv "\#{s... | true |
Other | Homebrew | brew | 603bdd01a81e62d6b97a5da26d75d409e839a8fa.json | Implement PR feedback | Library/Homebrew/cask/lib/hbc/cli/search.rb | @@ -17,7 +17,7 @@ def self.extract_regexp(string)
def self.search_remote(query)
matches = GitHub.search_code(user: "caskroom", path: "Casks",
filename: query, extension: "rb")
- Array(matches).map do |match|
+ matches.map do |match|
tap = Ta... | true |
Other | Homebrew | brew | 603bdd01a81e62d6b97a5da26d75d409e839a8fa.json | Implement PR feedback | Library/Homebrew/cmd/search.rb | @@ -104,7 +104,7 @@ def search_taps(query)
valid_dirnames = ["Formula", "HomebrewFormula", "Casks", "."].freeze
matches = GitHub.search_code(user: ["Homebrew", "caskroom"], filename: query, extension: "rb")
- Array(matches).map do |match|
+ matches.map do |match|
dirname, filename = File.split(... | true |
Other | Homebrew | brew | 603bdd01a81e62d6b97a5da26d75d409e839a8fa.json | Implement PR feedback | Library/Homebrew/test/utils/github_spec.rb | @@ -14,8 +14,8 @@
describe "::query_string" do
it "builds a query with the given hash parameters formatted as key:value" do
- query = subject.query_string(user: "Homebrew", repo: "Brew")
- expect(query).to eq("q=user%3AHomebrew+repo%3ABrew&per_page=100")
+ query = subject.query_string(user: "Ho... | true |
Other | Homebrew | brew | 603bdd01a81e62d6b97a5da26d75d409e839a8fa.json | Implement PR feedback | Library/Homebrew/utils/github.rb | @@ -296,12 +296,12 @@ def format_parameter(key, value)
end
def url_to(*subroutes)
- URI.parse(File.join(API_URL, *subroutes))
+ URI.parse([API_URL, *subroutes].join("/"))
end
def search(entity, *queries, **qualifiers)
uri = url_to "search", entity
uri.query = query_string(*queries, **qua... | true |
Other | Homebrew | brew | 65ae6bacd8c92d718b259f7efd50fc3fe9f0838b.json | add tests for hardcoded compilers in ENV | Library/Homebrew/rubocops/lines_cop.rb | @@ -108,16 +108,16 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\""
end
end
- #
- # find_instance_method_call(body_node, :ENV, :[]=) do |m|
- # param = paramete... | true |
Other | Homebrew | brew | 65ae6bacd8c92d718b259f7efd50fc3fe9f0838b.json | add tests for hardcoded compilers in ENV | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -817,7 +817,7 @@ def post_install
class Foo < Formula
desc "foo"
url 'http://example.com/foo-1.0.tgz'
- def test
+ def install
verbose = ARGV.verbose?
end
end
@@ -841,7 +841,7 @@ def test
class Foo < Formula
desc "f... | true |
Other | Homebrew | brew | 77468fdae36ee58580a643d8bc0fdd9f8b6e61c3.json | add tests for hard coded compilers in system calls | Library/Homebrew/rubocops/lines_cop.rb | @@ -99,15 +99,15 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "\"#{m.source}\" should be \"#{match[0]}\""
end
- # # Avoid hard-coding compilers
- # find_every_method_call_by_name(body_node, :system).each do |m|
- # param = paramet... | true |
Other | Homebrew | brew | 77468fdae36ee58580a643d8bc0fdd9f8b6e61c3.json | add tests for hard coded compilers in system calls | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -859,6 +859,54 @@ def test
expect_offense(expected, actual)
end
end
+
+ it "with hardcoded compiler 1 " do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def test
+ system "/usr/bin/gcc", "... | true |
Other | Homebrew | brew | af5cd1a1da0e1b87696ae72b8a5f1c174e83e94e.json | add tests for man+'man[1-8]' | Library/Homebrew/rubocops/lines_cop.rb | @@ -93,12 +93,12 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use build instead of ARGV to check options"
end
end
- #
- # find_instance_method_call(body_node, :man, :+) do |m|
- # next unless match = regex_match_grou... | true |
Other | Homebrew | brew | af5cd1a1da0e1b87696ae72b8a5f1c174e83e94e.json | add tests for man+'man[1-8]' | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -835,6 +835,30 @@ def test
expect_offense(expected, actual)
end
end
+
+ it "with man+ " do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def test
+ man1.install man+"man8" => "faad.1"
+ ... | true |
Other | Homebrew | brew | 76f4eccdceb5b3fb4e88b56e077234a6a3e56b08.json | add test for using ARGV to check options | Library/Homebrew/rubocops/lines_cop.rb | @@ -88,11 +88,11 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end
end
- # [:debug?, :verbose?, :value].each do |m|
- # find_instance_method_call(body_node, :ARGV, m) do
- # problem "Use build instead of ARGV to check options"
- ... | true |
Other | Homebrew | brew | 76f4eccdceb5b3fb4e88b56e077234a6a3e56b08.json | add test for using ARGV to check options | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -811,6 +811,30 @@ def post_install
expect_offense(expected, actual)
end
end
+
+ it "with using ARGV to check options" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def test
+ verbose = ... | true |
Other | Homebrew | brew | dc4d10ff6a59ce0da1bfc7bc06dd819c442813ab.json | add test for build.include? having dashed args | Library/Homebrew/rubocops/lines_cop.rb | @@ -314,12 +314,12 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
next unless match = regex_match_group(arg, %r{with(out)?-(.*)})
problem "Use build.with#{match[1]}? \"#{match[2]}\" instead of build.include? 'with#{match[1]}-#{match[2]}'"
end
- #
- ... | true |
Other | Homebrew | brew | dc4d10ff6a59ce0da1bfc7bc06dd819c442813ab.json | add test for build.include? having dashed args | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -787,6 +787,30 @@ def post_install
expect_offense(expected, actual)
end
end
+
+ it "with build.include? with dashed args" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def post_install
+ ... | true |
Other | Homebrew | brew | 3ff8be1216388817dda2b4bb95aeaa5c3d3d5a6b.json | add test for build.include? | Library/Homebrew/rubocops/lines_cop.rb | @@ -309,11 +309,11 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Don't duplicate 'with': Use `build.with? \"#{match[1]}\"` to check for \"--with-#{match[1]}\""
end
- # find_instance_method_call(body_node, :build, :include?) do |m|
- # arg ... | true |
Other | Homebrew | brew | 3ff8be1216388817dda2b4bb95aeaa5c3d3d5a6b.json | add test for build.include? | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -763,6 +763,30 @@ def post_install
expect_offense(expected, actual)
end
end
+
+ it "with build.include?" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def post_install
+ return if build... | true |
Other | Homebrew | brew | 24da1ecd3de86177f669072c542c9a01e6d6649d.json | Fix url encoded in expected values | Library/Homebrew/test/utils/github_spec.rb | @@ -15,17 +15,17 @@
describe "::query_string" do
it "builds a query with the given hash parameters formatted as key:value" do
query = subject.query_string(user: "Homebrew", repo: "Brew")
- expect(query).to eq("q=user%3aHomebrew+repo%3aTest&per_page=100")
+ expect(query).to eq("q=user%3AHomebrew... | false |
Other | Homebrew | brew | 5a7cbb762f1a9e715ae03e82eb6cb8ef4ac4a0bb.json | add test for build.with? "--with-foo" | Library/Homebrew/rubocops/lines_cop.rb | @@ -303,12 +303,12 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Don't duplicate 'without': Use `build.without? \"#{match[1]}\"` to check for \"--without-#{match[1]}\""
end
- # find_instance_method_call(body_node, :build, :with?) do |m|
- # ... | true |
Other | Homebrew | brew | 5a7cbb762f1a9e715ae03e82eb6cb8ef4ac4a0bb.json | add test for build.with? "--with-foo" | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -716,7 +716,7 @@ def post_install
end
end
- it "with negated build.with?" do
+ it "with duplicated build.without?" do
source = <<-EOS.undent
class Foo < Formula
desc "foo"
@@ -739,6 +739,30 @@ def post_install
expect_offense(expected, actual)
end
en... | true |
Other | Homebrew | brew | 02a1406a2e4c2d0506861248eb767d99f5ce4515.json | add test for build.without --without-foo | Library/Homebrew/rubocops/lines_cop.rb | @@ -297,12 +297,12 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Don't negate 'build.without?': use 'build.with?'"
end
- # find_instance_method_call(body_node, :build, :without?) do |m|
- # arg = parameters(m).first
- # next unl... | true |
Other | Homebrew | brew | 02a1406a2e4c2d0506861248eb767d99f5ce4515.json | add test for build.without --without-foo | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -715,6 +715,30 @@ def post_install
expect_offense(expected, actual)
end
end
+
+ it "with negated build.with?" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def post_install
+ return if ... | true |
Other | Homebrew | brew | e14fedd1b35480ea3707689db044140d18662b9c.json | Add test for negated build.with? | Library/Homebrew/rubocops/extend/formula_cop.rb | @@ -252,11 +252,15 @@ def method_called_in_block?(node, method_name)
end
# Check if method_name is called among the direct children nodes in the given node
+ # Check if the node itself is the method
def method_called?(node, method_name)
+ if node.send_type? && node.method_name == meth... | true |
Other | Homebrew | brew | e14fedd1b35480ea3707689db044140d18662b9c.json | Add test for negated build.with? | Library/Homebrew/rubocops/lines_cop.rb | @@ -287,11 +287,11 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use if #{correct} instead of unless #{m.source}"
end
- # find_instance_method_call(body_node, :build, :with?) do |m|
- # next unless negation?(m)
- # problem "Don'... | true |
Other | Homebrew | brew | e14fedd1b35480ea3707689db044140d18662b9c.json | Add test for negated build.with? | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -667,6 +667,30 @@ def post_install
expect_offense(expected, actual)
end
end
+
+ it "with negated build.with?" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def post_install
+ return if ... | true |
Other | Homebrew | brew | ec2b0df10e62152529386cf2a696f9aaece405ea.json | Add tests for unless build.with? | Library/Homebrew/rubocops/lines_cop.rb | @@ -281,12 +281,12 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use if #{correct} instead of unless #{m.source}"
end
- # find_instance_method_call(body_node, :build, :with?) do |m|
- # next unless unless_modifier?(m.parent)
- # ... | true |
Other | Homebrew | brew | ec2b0df10e62152529386cf2a696f9aaece405ea.json | Add tests for unless build.with? | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -643,6 +643,30 @@ def post_install
expect_offense(expected, actual)
end
end
+
+ it "with unless build.with?" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def post_install
+ return unle... | true |
Other | Homebrew | brew | f968776e8460d7b6a0a3199d9c92c945cda0738d.json | Add tests for unless build.without? | Library/Homebrew/rubocops/lines_cop.rb | @@ -274,13 +274,13 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
if find_method_def(@processed_source.ast)
problem "Define method #{method_name(@offensive_node)} in the class body, not at the top-level"
end
- #
- # find_instance_method_call(... | true |
Other | Homebrew | brew | f968776e8460d7b6a0a3199d9c92c945cda0738d.json | Add tests for unless build.without? | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -619,6 +619,30 @@ class Foo < Formula
expect_offense(expected, actual)
end
end
+
+ it "with unless build.without?" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ def post_install
+ retur... | true |
Other | Homebrew | brew | 91b139aca293bea1aa926c5301754e8603c9275e.json | Fix syntax error | Library/Homebrew/utils/github.rb | @@ -284,7 +284,7 @@ def query_string(*main_params, **qualifiers)
if value.is_a? Array
value.each { |v| params_list << format_parameter(key, v) }
else
- params_list << format_parameter(key, v)
+ params_list << format_parameter(key, value)
end
end
| false |
Other | Homebrew | brew | 6dad9d8b44e22f2729a2db95a1c2d14b3e84d477.json | Add test for top level method def | Library/Homebrew/rubocops/extend/formula_cop.rb | @@ -232,6 +232,7 @@ def find_method_def(node, method_name = nil)
@offense_source_range = def_node.source_range
return def_node
end
+ return if node.parent.nil?
# If not found then, parent node becomes the offensive node
@offensive_node = node.parent
@offe... | true |
Other | Homebrew | brew | 6dad9d8b44e22f2729a2db95a1c2d14b3e84d477.json | Add test for top level method def | Library/Homebrew/rubocops/lines_cop.rb | @@ -271,9 +271,9 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Use the `#{match}` Ruby method instead of `#{m.source}`"
end
- # if find_method_def(@processed_source.ast)
- # problem "Define method #{method_name(@offensive_node)} in the cla... | true |
Other | Homebrew | brew | 6dad9d8b44e22f2729a2db95a1c2d14b3e84d477.json | Add test for top level method def | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -592,6 +592,29 @@ class Foo < Formula
inspect_source(cop, source)
+ expected_offenses.zip(cop.offenses).each do |expected, actual|
+ expect_offense(expected, actual)
+ end
+ end
+ it "with a top-level function def " do
+ source = <<-EOS.undent
+ def test
+ nil
... | true |
Other | Homebrew | brew | 7dfe09ccae5b1a8309326e5a5cb3172fbcd795d3.json | Add tests for fileUtils call in system | Library/Homebrew/rubocops/lines_cop.rb | @@ -263,13 +263,14 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "Dir([\"#{string_content(path)}\"]) is unnecessary; just use \"#{match[0]}\""
end
- #
- # fileUtils_methods= FileUtils.singleton_methods(false).map { |m| Regexp.escape(m) }.join... | true |
Other | Homebrew | brew | 7dfe09ccae5b1a8309326e5a5cb3172fbcd795d3.json | Add tests for fileUtils call in system | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -571,6 +571,27 @@ class Foo < Formula
inspect_source(cop, source)
+ expected_offenses.zip(cop.offenses).each do |expected, actual|
+ expect_offense(expected, actual)
+ end
+ end
+ it "with system call to fileUtils Method" do
+ source = <<-EOS.undent
+ class Foo < Formula... | true |
Other | Homebrew | brew | a73c29fef21ccb7f45243500f04f1ed9965fdf38.json | add tests for non glob dirs audit | Library/Homebrew/rubocops/lines_cop.rb | @@ -255,11 +255,14 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
problem "\"#{m.source}\" is deprecated, use a comparison to MacOS.version instead"
end
end
- #
- # dirPattern(body_node) do |m|
- # next unless m =~ /\[("[^\*{},... | true |
Other | Homebrew | brew | a73c29fef21ccb7f45243500f04f1ed9965fdf38.json | add tests for non glob dirs audit | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -552,6 +552,29 @@ class Foo < Formula
expect_offense(expected, actual)
end
end
+
+ it "with non glob DIR" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ desc "foo"
+ url 'http://example.com/foo-1.0.tgz'
+ rm_rf Dir["src/{llvm,test,librustdoc,etc/sna... | true |
Other | Homebrew | brew | 77105b809a83583e3da5726105dc9cd913112913.json | Add tests for macOS check | Library/Homebrew/rubocops/lines_cop.rb | @@ -248,13 +248,13 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
next unless method_called?(m, :new)
problem "`depends_on` can take requirement classes instead of instances"
end
- #
- # os = [:leopard?, :snow_leopard?, :lion?, :mountain_li... | true |
Other | Homebrew | brew | 77105b809a83583e3da5726105dc9cd913112913.json | Add tests for macOS check | Library/Homebrew/test/rubocops/lines_cop_spec.rb | @@ -527,6 +527,27 @@ class Foo < Formula
inspect_source(cop, source)
+ expected_offenses.zip(cop.offenses).each do |expected, actual|
+ expect_offense(expected, actual)
+ end
+ end
+ it "with old style OS check" do
+ source = <<-EOS.undent
+ class Foo < Formula
+ d... | true |
Other | Homebrew | brew | 1939952dc46eab137a52170da407218fd8db0434.json | Remove some hedge words. | docs/Python-for-Formula-Authors.md | @@ -10,7 +10,7 @@ Bindings are a special case of libraries that allow Python code to interact with
Homebrew is happy to accept applications that are built in Python, whether the apps are available from PyPI or not. Homebrew generally won't accept libraries that can be installed correctly with `pip install foo`. Bind... | false |
Other | Homebrew | brew | 4760f4e8032694d37f934257f6a58f0164438151.json | Raise an exception when double loading a formula
(As proposed in #2673) | Library/Homebrew/formulary.rb | @@ -20,6 +20,8 @@ def self.load_formula(name, path, contents, namespace)
raise "Formula loading disabled by HOMEBREW_DISABLE_LOAD_FORMULA!"
end
+ raise "Formula #{name} has already been loaded" if const_defined?(namespace)
+
mod = Module.new
const_set(namespace, mod)
begin | true |
Other | Homebrew | brew | 4760f4e8032694d37f934257f6a58f0164438151.json | Raise an exception when double loading a formula
(As proposed in #2673) | Library/Homebrew/test/formulary_spec.rb | @@ -27,6 +27,16 @@ def install
let(:bottle_dir) { Pathname.new("#{TEST_FIXTURE_DIR}/bottles") }
let(:bottle) { bottle_dir/"testball_bottle-0.1.#{Utils::Bottles.tag}.bottle.tar.gz" }
+ describe "::load_formula" do
+ it "does not allow namespace repetition" do |example|
+ definition = "Foo = Class.new(Fo... | true |
Other | Homebrew | brew | b06fceda57ea8306e130ba11ccb2bd71f6907c23.json | Add a test | Library/Homebrew/cmd/search.rb | @@ -48,7 +48,7 @@ def search
result = Formulary.factory(query).name
results = Array(result)
rescue FormulaUnavailableError
- results = search_taps(query)
+ results = search_taps(query.split('/')[-1])
end
puts Formatter.columns(results) unless results.empty? | true |
Other | Homebrew | brew | b06fceda57ea8306e130ba11ccb2bd71f6907c23.json | Add a test | Library/Homebrew/test/cmd/search_spec.rb | @@ -1,6 +1,7 @@
describe "brew search", :integration_test do
before(:each) do
setup_test_formula "testball"
+ setup_remote_tap "caskroom/cask/test"
end
it "lists all available Formulae when no argument is given" do
@@ -24,6 +25,13 @@
.and be_a_success
end
+ it "falls back to a tap searc... | true |
Other | Homebrew | brew | 0e3f1ab27337338c19996a15e8f1e3b72ec270f1.json | Note cases when pinned formulae get upgraded.
Fixes #3021. | Library/Homebrew/cmd/pin.rb | @@ -1,6 +1,7 @@
#: * `pin` <formulae>:
#: Pin the specified <formulae>, preventing them from being upgraded when
-#: issuing the `brew upgrade` command. See also `unpin`.
+#: issuing the `brew upgrade <formulae>` command (but can still be upgraded
+#: as dependencies for other formulae). See also `unpin`... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.