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 | deffac58cd2c4a596ea0573c3f91cb239fd2c1ff.json | sorbet: update RBI files using Tapioca.
Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/tapioca.yml). | Library/Homebrew/sorbet/rbi/gems/codecov@0.2.7.rbi | @@ -0,0 +1,8 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `codecov` gem.
+# Please instead update this file by running `tapioca sync --exclude json`.
+
+# typed: true
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-req... | true |
Other | Homebrew | brew | deffac58cd2c4a596ea0573c3f91cb239fd2c1ff.json | sorbet: update RBI files using Tapioca.
Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/tapioca.yml). | Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.3.rbi | @@ -0,0 +1,537 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `tapioca` gem.
+# Please instead update this file by running `tapioca sync --exclude json`.
+
+# typed: true
+
+module Tapioca
+ class << self
+ def silence_warnings(&blk); end
+ end
+end
+
+class Tapioca::Cli < ... | true |
Other | Homebrew | brew | dcc6e7c5147b2c3a7a9cfd68bbed8dc289e93c35.json | workflows/tapioca: fetch origin/master and reset to it | .github/workflows/tapioca.yml | @@ -39,6 +39,8 @@ jobs:
bundle exec tapioca sync --exclude json
bundle exec srb rbi hidden-definitions
+ git fetch origin master
+ git reset --hard origin/master
git checkout -B tapioca-update
git add sorbet
if ! git diff --no-patch --exit-code ... | false |
Other | Homebrew | brew | dc56b53392cc005e282b470d03364b66f41808a5.json | workflows: add missing git subcommand | .github/workflows/tapioca.yml | @@ -42,7 +42,7 @@ jobs:
git checkout -B tapioca-update
git reset origin/master
git add sorbet
- if ! git --no-patch --exit-code HEAD -- sorbet; then
+ if ! git diff --no-patch --exit-code HEAD -- sorbet; then
if ! git ls-remote --exit-code --heads origin t... | false |
Other | Homebrew | brew | cba751a34320a57be5dfec052ffd92783399e2d4.json | docs: add sorbet documentation
(cherry picked from commit 022571489a0f94ed54a0908167b553592cfe3277) | docs/README.md | @@ -46,6 +46,7 @@
- [How To Create (And Maintain) A Tap](How-to-Create-and-Maintain-a-Tap.md)
- [Brew Test Bot](Brew-Test-Bot.md)
- [Prose Style Guidelines](Prose-Style-Guidelines.md)
+- [Type Checking with Sorbet](Typechecking.md)
## Maintainers
| true |
Other | Homebrew | brew | cba751a34320a57be5dfec052ffd92783399e2d4.json | docs: add sorbet documentation
(cherry picked from commit 022571489a0f94ed54a0908167b553592cfe3277) | docs/Typechecking.md | @@ -0,0 +1,84 @@
+# Type Checking with Sorbet
+
+The majority of the code in Homebrew is written in Ruby which is a dynamic
+language. To avail the benefits of static type checking, we have set up Sorbet in
+our codebase which provides the benefits of static type checking to dynamic languages
+like Ruby. <br> [Sorbet's... | true |
Other | Homebrew | brew | 982c7adaf2227ab2f47986117337d21b30a2e65e.json | .github/workflows: add action to update tapioca definitions
- Tapioca is a companion gem to Sorbet that generates RBI files for the
Ruby gems in a project.
- Whenever Dependabot updates a gem, Tapioca has to regenerate that gem's
RBI files so that Sorbet can accurately assess the state of the typing
of a codebas... | .github/workflows/tapioca-update.yml | @@ -0,0 +1,57 @@
+name: Tapioca Update
+on:
+ push:
+ paths:
+ - .github/workflows/tapioca-update.yml
+ schedule:
+ - cron: '0 0 */3 * *' # every three days
+env:
+ HOMEBREW_SORBET: 1
+jobs:
+ update-tapioca:
+ if: github.repository == 'Homebrew/brew'
+ runs-on: ubuntu-latest
+ steps:
+ - n... | false |
Other | Homebrew | brew | e8143e5de7726a4ba4c1fd5e82d4b3ab5f5dff9a.json | cask/exceptions: fix super calls.
Ensure that we always pass no arguments here. | Library/Homebrew/cask/exceptions.rb | @@ -5,7 +5,7 @@ class CaskError < RuntimeError; end
class MultipleCaskErrors < CaskError
def initialize(errors)
- super
+ super()
@errors = errors
end
@@ -172,7 +172,7 @@ class CaskQuarantineError < CaskError
attr_reader :path, :reason
def initialize(path, reason)
- su... | false |
Other | Homebrew | brew | d530cf68078d3b60f12032a606e5f319a4052288.json | utils/pypi: add salt to blocklist | Library/Homebrew/utils/pypi.rb | @@ -14,6 +14,7 @@ module PyPI
dxpy
ipython
molecule
+ salt
xonsh
].freeze
| false |
Other | Homebrew | brew | 86eca5ab4487f79b2f1c60645cca440d4bd068aa.json | test/os/mac: add tests to validate library versions | Library/Homebrew/test/os/mac/pkgconfig_spec.rb | @@ -0,0 +1,126 @@
+# frozen_string_literal: true
+
+# These tests assume the needed SDKs are correctly installed, i.e. `brew doctor` passes.
+# The CLT version installed should be the latest available for the running OS.
+# The tests do not check other OS versions beyond than the one the tests are being run on.
+#
+# I... | false |
Other | Homebrew | brew | 57c02af359a948aef5e1bbf3d74b82395c0b7287.json | Add template titles | .github/ISSUE_TEMPLATE/bug.md | @@ -4,6 +4,8 @@ about: "If you're sure it's reproducible and not just your machine: submit an is
---
+# Bug report
+
**Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to u... | true |
Other | Homebrew | brew | 57c02af359a948aef5e1bbf3d74b82395c0b7287.json | Add template titles | .github/ISSUE_TEMPLATE/feature.md | @@ -4,6 +4,8 @@ about: Request our thoughts on your suggestion for a new feature for Homebrew.
---
+# Feature suggestion
+
**Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fai... | true |
Other | Homebrew | brew | 6eb07d70f04d67345934764bb4316c8af43d5cb1.json | formula: convert license array to hash | Library/Homebrew/formula.rb | @@ -2232,7 +2232,14 @@ def method_added(method)
# <pre>license all_of: ["MIT", "GPL-2.0-only"]</pre>
# <pre>license "GPL-2.0-only" => { with: "LLVM-exception" }</pre>
# <pre>license :public_domain</pre>
- attr_rw :license
+ def license(args = nil)
+ if args.nil?
+ @licenses
+ else
... | true |
Other | Homebrew | brew | 6eb07d70f04d67345934764bb4316c8af43d5cb1.json | formula: convert license array to hash | Library/Homebrew/test/utils/spdx_spec.rb | @@ -167,10 +167,6 @@
expect(described_class.license_expression_to_string(any_of: ["MIT", "EPL-1.0+"])).to eq "MIT or EPL-1.0+"
end
- it "treats array as any_of:" do
- expect(described_class.license_expression_to_string(["MIT", "EPL-1.0+"])).to eq "MIT or EPL-1.0+"
- end
-
it "returns licen... | true |
Other | Homebrew | brew | 6eb07d70f04d67345934764bb4316c8af43d5cb1.json | formula: convert license array to hash | Library/Homebrew/utils/spdx.rb | @@ -83,8 +83,7 @@ def license_expression_to_string(license_expression, bracket: false, hash_type:
license_expression
when :public_domain
"Public Domain"
- when Hash, Array
- license_expression = { any_of: license_expression } if license_expression.is_a? Array
+ when Hash
expressions... | true |
Other | Homebrew | brew | 2ed4196d73f407833e09ae3565506a80ef6ec485.json | cmd/update-report: fix output of new casks | Library/Homebrew/cmd/update-report.rb | @@ -466,7 +466,7 @@ def dump_formula_report(key, title)
when :A
name unless installed?(name)
when :AC
- name unless cask_installed?(name)
+ name.split("/").last unless cask_installed?(name)
when :MC, :DC
name = name.split("/").last
cask_installed?(name) ? pr... | false |
Other | Homebrew | brew | 1f7df4881232246409be800783a59fce6d377483.json | audit: remove redundant check
Co-authored-by: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/dev-cmd/audit.rb | @@ -399,7 +399,7 @@ def audit_license
github_license = GitHub.get_repo_license(user, repo)
return unless github_license
- return if github_license && (licenses + ["NOASSERTION"]).include?(github_license)
+ return if (licenses + ["NOASSERTION"]).include?(github_license)
return ... | false |
Other | Homebrew | brew | 77d25da5e5420d2e17c721f010cc06704d1d20d5.json | Fix missing methods in cask DSL. | Library/Homebrew/cask/dsl.rb | @@ -282,6 +282,10 @@ def auto_updates(auto_updates = nil)
end
end
+ def respond_to_missing?(*)
+ super
+ end
+
def method_missing(method, *)
if method
Utils.method_missing_message(method, token)
@@ -291,10 +295,6 @@ def method_missing(method, *)
end
end
- d... | true |
Other | Homebrew | brew | 77d25da5e5420d2e17c721f010cc06704d1d20d5.json | Fix missing methods in cask DSL. | Library/Homebrew/cask/dsl/base.rb | @@ -18,6 +18,10 @@ def system_command(executable, **options)
@command.run!(executable, **options)
end
+ def respond_to_missing?(*)
+ super
+ end
+
def method_missing(method, *)
if method
underscored_class = self.class.name.gsub(/([[:lower:]])([[:upper:]][[:l... | true |
Other | Homebrew | brew | 77d25da5e5420d2e17c721f010cc06704d1d20d5.json | Fix missing methods in cask DSL. | Library/Homebrew/cask/utils.rb | @@ -80,12 +80,11 @@ def self.error_message_with_suggestions
end
def self.method_missing_message(method, token, section = nil)
- poo = []
- poo << "Unexpected method '#{method}' called"
- poo << "during #{section}" if section
- poo << "on Cask #{token}."
+ message = +"Unexpected meth... | true |
Other | Homebrew | brew | d45701cf9b6d369049053c675883b4178541f277.json | Switch `greedy` argument to a keyword
The `greedy` parameter was switched to a keyword parameter in
3a91c37e66661781a236422c4ab8fc597e09a7a1 but this call wasn't updated
accordingly. | Library/Homebrew/cmd/outdated.rb | @@ -197,7 +197,7 @@ def select_outdated(formulae_or_casks, args:)
if formula_or_cask.is_a?(Formula)
formula_or_cask.outdated?(fetch_head: args.fetch_HEAD?)
else
- formula_or_cask.outdated?(args.greedy?)
+ formula_or_cask.outdated?(greedy: args.greedy?)
end
end
end | false |
Other | Homebrew | brew | e215b3df75bbc355e0e1872258055ab270db4844.json | dev-cmd/audit: update license checks to new style | Library/Homebrew/dev-cmd/audit.rb | @@ -119,18 +119,20 @@ def audit
# Check style in a single batch run up front for performance
style_results = Style.check_style_json(style_files, options) if style_files
# load licenses
- spdx_data = SPDX.spdx_data
+ spdx_license_data = SPDX.license_data
+ spdx_exception_data = SPDX.exception_dat... | true |
Other | Homebrew | brew | e215b3df75bbc355e0e1872258055ab270db4844.json | dev-cmd/audit: update license checks to new style | Library/Homebrew/test/dev-cmd/audit_spec.rb | @@ -3,6 +3,7 @@
require "dev-cmd/audit"
require "formulary"
require "cmd/shared_examples/args_parse"
+require "utils/spdx"
describe "Homebrew.audit_args" do
it_behaves_like "parseable arguments"
@@ -80,20 +81,21 @@ class Foo < Formula
end
describe "#audit_license" do
- let(:spdx_data) {
- ... | true |
Other | Homebrew | brew | 60ec30d41eeee3ea71e8d0755f41d2780aae2052.json | formula: update license specification | Library/.rubocop.yml | @@ -68,6 +68,10 @@ Style/HashTransformKeys:
Style/HashTransformValues:
Enabled: true
+# Allow for license expressions
+Style/HashAsLastArrayItem:
+ Enabled: false
+
# Enabled now LineLength is lowish.
Style/IfUnlessModifier:
Enabled: true | true |
Other | Homebrew | brew | 60ec30d41eeee3ea71e8d0755f41d2780aae2052.json | formula: update license specification | Library/Homebrew/.rubocop.yml | @@ -61,6 +61,8 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Enabled: true
Max: 600
+ Exclude:
+ - 'test/**/*'
Metrics/PerceivedComplexity:
Enabled: true
Max: 90
@@ -143,3 +145,9 @@ Style/GuardClause:
# so many of these in formulae but none in here
Style/StringConcatenation:
Enabled: true
+
+# d... | true |
Other | Homebrew | brew | 60ec30d41eeee3ea71e8d0755f41d2780aae2052.json | formula: update license specification | Library/Homebrew/cmd/info.rb | @@ -8,6 +8,7 @@
require "keg"
require "tab"
require "json"
+require "utils/spdx"
module Homebrew
module_function
@@ -211,13 +212,7 @@ def info_formula(f, args:)
puts "From: #{Formatter.url(github_info(f))}"
- if f.license.present?
- licenses = f.license
- .map(&:to_s)
- ... | true |
Other | Homebrew | brew | 60ec30d41eeee3ea71e8d0755f41d2780aae2052.json | formula: update license specification | Library/Homebrew/formula.rb | @@ -2219,18 +2219,20 @@ def method_added(method)
# @!attribute [w]
# The SPDX ID of the open-source license that the formula uses.
# Shows when running `brew info`.
- # Multiple licenses means that the software is licensed under multiple licenses.
- # Do not use multiple licenses if e.g. different ... | true |
Other | Homebrew | brew | 60ec30d41eeee3ea71e8d0755f41d2780aae2052.json | formula: update license specification | Library/Homebrew/formula_installer.rb | @@ -19,6 +19,7 @@
require "cask/cask_loader"
require "cmd/install"
require "find"
+require "utils/spdx"
class FormulaInstaller
include FormulaCellarChecks
@@ -1130,24 +1131,29 @@ def forbidden_license_check
.to_s
.sub("Pu... | true |
Other | Homebrew | brew | fc7c3c923af33abf3376c7210a1a0809d512760f.json | cmd/update-reset: fix handling of multiple relative directories | Library/Homebrew/cmd/update-reset.sh | @@ -35,16 +35,15 @@ homebrew-update-reset() {
for DIR in "${REPOS[@]}"
do
[[ -d "$DIR/.git" ]] || continue
- cd "$DIR" || continue
ohai "Fetching $DIR..."
- git fetch --force --tags origin
- git remote set-head origin --auto >/dev/null
+ git -C "$DIR" fetch --force --tags origin
+ git -C ... | false |
Other | Homebrew | brew | b43f17b2d0503dbec503e5a4d53441ed2eac6add.json | formula_versions: handle references to too old MacOS in formulae | Library/Homebrew/formula_versions.rb | @@ -64,6 +64,9 @@ def bottle_version_map(branch)
versions_seen = (map.keys + [f.pkg_version]).uniq.length
end
return map if versions_seen > MAX_VERSIONS_DEPTH
+ rescue MacOSVersionError => e
+ odebug "#{e} in #{name} at revision #{rev}" if debug?
+ break
end
map
end | false |
Other | Homebrew | brew | afe9a48373cf2c1a423464b45a464d3971ee114b.json | Add limit to repology api | Library/Homebrew/dev-cmd/bump.rb | @@ -38,7 +38,7 @@ def bump
response
else
- Repology.parse_api_response
+ Repology.parse_api_response(requested_limit)
end
validated_formulae = {} | true |
Other | Homebrew | brew | afe9a48373cf2c1a423464b45a464d3971ee114b.json | Add limit to repology api | Library/Homebrew/utils/repology.rb | @@ -5,8 +5,6 @@
module Repology
module_function
- MAX_PAGINATION = 15
-
def query_api(last_package_in_response = "")
last_package_in_response += "/" if last_package_in_response.present?
url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=homebrew&outdated=1"
@@ -28,25 +26,... | true |
Other | Homebrew | brew | e08891812843bbd732c98af1906fc843ac2712e9.json | cask home: Remove deprecation comment | Library/Homebrew/cask/cmd/home.rb | @@ -8,9 +8,6 @@ def self.description
end
def run
- # TODO: enable for next major/minor release
- # odeprecated "brew cask home", "brew home"
-
if casks.none?
odebug "Opening project homepage"
self.class.open_url "https://brew.sh/" | false |
Other | Homebrew | brew | 543f421702cd0feb13c30979cb157d6e85503da0.json | cask --cache: Remove deprecation comment | Library/Homebrew/cask/cmd/--cache.rb | @@ -18,9 +18,6 @@ def self.command_name
end
def run
- # TODO: enable for next major/minor release
- # odeprecated "brew cask --cache", "brew --cache --cask"
-
casks.each do |cask|
puts self.class.cached_location(cask)
end | false |
Other | Homebrew | brew | b123fca2270c4cd15167e70304004d14f9cc1983.json | cask: Add TODOs to deprecate integrated cask cmds | Library/Homebrew/cask/cmd.rb | @@ -47,6 +47,16 @@ class Cmd
"dr" => "doctor",
}.freeze
+ DEPRECATED_COMMANDS = {
+ Cmd::Cache => "brew --cache --cask",
+ Cmd::Doctor => "brew doctor --verbose",
+ Cmd::Home => "brew home",
+ Cmd::List => "brew list --cask",
+ Cmd::Outdated => "brew out... | false |
Other | Homebrew | brew | b338398a8c002953d64852c51f0d7b5e9c419332.json | tab: add built_on & arch information | Library/Homebrew/development_tools.rb | @@ -99,6 +99,15 @@ def curl_handles_most_https_certificates?
def subversion_handles_most_https_certificates?
true
end
+
+ def build_system_info
+ {
+ "os" => ENV["HOMEBREW_SYSTEM"],
+ "os_version" => OS_VERSION,
+ "cpu_family" => Hardware::CPU.family,
+ }
+ ... | true |
Other | Homebrew | brew | b338398a8c002953d64852c51f0d7b5e9c419332.json | tab: add built_on & arch information | Library/Homebrew/extend/os/mac/development_tools.rb | @@ -56,5 +56,13 @@ def custom_installation_instructions
brew install gcc
EOS
end
+
+ def build_system_info
+ build_info = {
+ "xcode" => MacOS::Xcode.version.to_s.presence,
+ "clt" => MacOS::CLT.version.to_s.presence,
+ }
+ generic_build_system_info.merge build_i... | true |
Other | Homebrew | brew | b338398a8c002953d64852c51f0d7b5e9c419332.json | tab: add built_on & arch information | Library/Homebrew/tab.rb | @@ -36,6 +36,7 @@ def self.create(formula, compiler, stdlib)
"stdlib" => stdlib,
"aliases" => formula.aliases,
"runtime_dependencies" => Tab.runtime_deps_hash(runtime_deps),
+ "arch" => Hardware::CPU.arch,
"source" ... | true |
Other | Homebrew | brew | b338398a8c002953d64852c51f0d7b5e9c419332.json | tab: add built_on & arch information | Library/Homebrew/test/caveats_spec.rb | @@ -120,7 +120,7 @@ def plist
"plist_test.plist"
end
end
- allow(ENV).to receive(:[]).with("TMUX").and_return(true)
+ ENV["TMUX"] = "1"
allow(Homebrew).to receive(:_system).with("/usr/bin/pbpaste").and_return(false)
caveats = described_class.new(f).caveat... | true |
Other | Homebrew | brew | dbbc14040d7acc94ca6e40c39ca60b38aa1419b0.json | extend/os/mac: install svn on catalina and newer | Library/Homebrew/extend/os/mac/dependency_collector.rb | @@ -6,7 +6,9 @@ class DependencyCollector
def git_dep_if_needed(tags); end
- def subversion_dep_if_needed(tags); end
+ def subversion_dep_if_needed(tags)
+ Dependency.new("subversion", tags) if MacOS.version >= :catalina
+ end
def cvs_dep_if_needed(tags)
Dependency.new("cvs", tags) | true |
Other | Homebrew | brew | dbbc14040d7acc94ca6e40c39ca60b38aa1419b0.json | extend/os/mac: install svn on catalina and newer | Library/Homebrew/test/os/mac/dependency_collector_spec.rb | @@ -32,6 +32,10 @@
specify "Resource dependency from a Subversion URL" do
resource = Resource.new
resource.url("svn://brew.sh/foo/bar")
- expect(subject.add(resource)).to be nil
+ if MacOS.version < :catalina
+ expect(subject.add(resource)).to be nil
+ else
+ expect(subject.add(resource)... | true |
Other | Homebrew | brew | 420e8fdbe4742eb655a58c7faabfca6fe200d4a8.json | pr-automerge: pluralize message only when needed | Library/Homebrew/dev-cmd/pr-automerge.rb | @@ -49,7 +49,7 @@ def pr_automerge
return
end
- ohai "#{prs.size} matching pull requests:"
+ ohai "#{prs.count} matching pull #{"request".pluralize(prs.count)}:"
pr_urls = []
prs.each do |pr|
puts "#{tap.full_name unless tap.core_tap?}##{pr["number"]}: #{pr["title"]}" | false |
Other | Homebrew | brew | db361e29b8d4909757e624fafdfb6186d0fe112a.json | check_tmpdir_executable: Remove stray undent
Fix the error:
Error: undefined method undent for #<String>
.../extend/os/linux/diagnostic.rb:41:in check_tmpdir_executable | Library/Homebrew/extend/os/linux/diagnostic.rb | @@ -38,7 +38,7 @@ def check_tmpdir_executable
f.close
return if system f.path
- <<~EOS.undent
+ <<~EOS
The directory #{HOMEBREW_TEMP} does not permit executing
programs. It is likely mounted as "noexec". Please set HOMEBREW_TEMP
in your #{shell_profile}... | false |
Other | Homebrew | brew | b63b56f4c2193c76a6a8674db36816509a7ea498.json | home: Remove warning for cask with same name | Library/Homebrew/cmd/home.rb | @@ -25,10 +25,7 @@ def home
end
homepages = args.formulae_and_casks.map do |formula_or_cask|
- disclaimer = disclaimers(formula_or_cask)
- disclaimer = " (#{disclaimer})" if disclaimer.present?
-
- puts "Opening homepage for #{name_of(formula_or_cask)}#{disclaimer}"
+ puts "Opening homep... | true |
Other | Homebrew | brew | b63b56f4c2193c76a6a8674db36816509a7ea498.json | home: Remove warning for cask with same name | Library/Homebrew/test/cli/named_args_spec.rb | @@ -99,7 +99,6 @@
named_args = described_class.new("foo", "baz")
allow(named_args).to receive(:resolve_keg).and_call_original
allow(named_args).to receive(:resolve_keg).with("foo").and_return foo_keg
-
stub_cask_loader baz, call_original: true
kegs, casks = named_args.to_kegs_to_cas... | true |
Other | Homebrew | brew | b8d21dcf6008dafa4e9e9c2e1c56e5e1c057e1d2.json | brew.sh: handle Linux systems with no 'locale' | Library/Homebrew/brew.sh | @@ -6,15 +6,18 @@ case "$HOMEBREW_SYSTEM" in
esac
# Force UTF-8 to avoid encoding issues for users with broken locale settings.
-if ! command -v locale >/dev/null
-then
- export LC_ALL=C
-elif [[ "$(locale charmap)" != "UTF-8" ]]
+if [[ -n "$HOMEBREW_MACOS" ]]
then
- if [[ -n "$HOMEBREW_MACOS" ]]
+ if [[ "$(loc... | false |
Other | Homebrew | brew | dc1bbe7f81a453079d397c387cc55a53ee22eb13.json | handle requests for multiple formulae | Library/Homebrew/dev-cmd/bump.rb | @@ -23,21 +23,39 @@ def bump_args
def bump
args = bump_args.parse
- requested_formula = args.formulae.first.to_s if args.formulae.first
+ requested_formulae = !args.formulae.empty? ? args.formulae.map(&:name) : nil
+
requested_limit = args.limit.to_i if args.limit.present?
- raise FormulaUnava... | true |
Other | Homebrew | brew | dc1bbe7f81a453079d397c387cc55a53ee22eb13.json | handle requests for multiple formulae | Library/Homebrew/utils/repology.rb | @@ -58,7 +58,6 @@ def validate_and_format_packages(outdated_repology_packages, limit)
packages = {}
outdated_repology_packages.each do |_name, repositories|
- # identify homebrew repo
repology_homebrew_repo = repositories.find do |repo|
repo["repo"] == "homebrew"
end | true |
Other | Homebrew | brew | 5d38cd7296dabb5cf1a0f0065c82697b12f70229.json | cask/list: fix artifact list | Library/Homebrew/cask/cmd/list.rb | @@ -1,5 +1,7 @@
# frozen_string_literal: true
+require "cask/artifact/relocated"
+
module Cask
class Cmd
class List < AbstractCommand
@@ -48,17 +50,23 @@ def self.list_casks(*casks, json: false, one: false, full_name: false, versions:
elsif versions
puts output.map(&method(:format_versio... | true |
Other | Homebrew | brew | 5d38cd7296dabb5cf1a0f0065c82697b12f70229.json | cask/list: fix artifact list | Library/Homebrew/test/cask/cmd/list_spec.rb | @@ -126,9 +126,9 @@
expect {
described_class.run("local-transmission", "local-caffeine")
}.to output(<<~EOS).to_stdout
- ==> Apps
+ ==> App
#{transmission.config.appdir.join("Transmission.app")} (#{transmission.config.appdir.join("Transmission.app").abv})
- ==> Apps
... | true |
Other | Homebrew | brew | 8fb6218d052cd7e33435ba88f3ecc38c62278e4c.json | bump-formula-pr: fix regression when formula.tap is Nil | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -105,8 +105,10 @@ def use_correct_linux_tap(formula, args:)
end
end
end
- origin_branch = Utils.popen_read("git", "-C", formula.tap.path.to_s, "symbolic-ref", "-q", "--short",
- "refs/remotes/origin/HEAD").chomp.presence
+ if formula.tap
+ origin_br... | false |
Other | Homebrew | brew | c8016f6c0af91ed5a105ea82911259a7bff03666.json | named args: add method tests | Library/Homebrew/test/cli/named_args_spec.rb | @@ -0,0 +1,112 @@
+# frozen_string_literal: true
+
+require "cli/named_args"
+
+describe Homebrew::CLI::NamedArgs do
+ let(:foo) do
+ formula "foo" do
+ url "https://brew.sh"
+ version "1.0"
+ end
+ end
+
+ let(:foo_keg) do
+ path = (HOMEBREW_CELLAR/"foo/1.0").resolved_path
+ mkdir_p path
+ ... | true |
Other | Homebrew | brew | c8016f6c0af91ed5a105ea82911259a7bff03666.json | named args: add method tests | Library/Homebrew/test/spec_helper.rb | @@ -36,6 +36,7 @@
require_relative "../global"
require "test/support/no_seed_progress_formatter"
+require "test/support/helper/cask"
require "test/support/helper/fixtures"
require "test/support/helper/formula"
require "test/support/helper/mktmpdir"
@@ -86,6 +87,7 @@
config.include(RuboCop::RSpec::ExpectOffe... | true |
Other | Homebrew | brew | c8016f6c0af91ed5a105ea82911259a7bff03666.json | named args: add method tests | Library/Homebrew/test/support/helper/cask.rb | @@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+require "cask/cask_loader"
+
+module Test
+ module Helper
+ module Cask
+ def stub_cask_loader(cask, ref = cask.token)
+ loader = ::Cask::CaskLoader::FromInstanceLoader.new cask
+ allow(::Cask::CaskLoader).to receive(:for).with(ref).and_return(lo... | true |
Other | Homebrew | brew | 4c833b241d3dcc1b1f1efa83dafba5c45877c5fa.json | Fix parsing of negative options. | Library/Homebrew/cli/parser.rb | @@ -73,6 +73,12 @@ def switch(*names, description: nil, env: nil, required_for: nil, depends_on: ni
description = option_to_description(*names) if description.nil?
process_option(*names, description)
@parser.public_send(method, *names, *wrap_option_desc(description)) do |value|
+ val... | true |
Other | Homebrew | brew | 4c833b241d3dcc1b1f1efa83dafba5c45877c5fa.json | Fix parsing of negative options. | Library/Homebrew/test/cli/parser_spec.rb | @@ -15,7 +15,7 @@
allow(Homebrew::EnvConfig).to receive(:pry?).and_return(true)
end
- context "when using negative options" do
+ context "when using binary options" do
subject(:parser) {
described_class.new do
switch "--[no-]positive"
@@ -33,6 +33,30 @@
end
end... | true |
Other | Homebrew | brew | 8df618958dbd459715f3d5ee6456092f4fec59af.json | bump-formula-pr: add warnings for patches and resources | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -133,6 +133,9 @@ def bump_formula_pr
new_version = args.version
check_closed_pull_requests(formula, tap_full_name, version: new_version, args: args) if new_version
+ opoo "This formula has patches that may be resolved upstream." if formula.patchlist.present?
+ opoo "This formula has resources that ... | false |
Other | Homebrew | brew | c983d85eea9d9579bfb8685c0e1fc73651cb8175.json | bump-formula-pr: add `determine_mirror` helper method | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -145,16 +145,7 @@ def bump_formula_pr
new_tag = args.tag
new_revision = args.revision
new_mirrors ||= args.mirror
- new_mirror ||= case new_url
- when %r{.*ftp.gnu.org/gnu.*}
- new_url.sub "ftp.gnu.org/gnu", "ftpmirror.gnu.org"
- when %r{.*download.savannah.gnu.org/*}
- new_url.sub ... | false |
Other | Homebrew | brew | efbfb90c42b6c106ab71c7a5340e05b81e7a133b.json | Use cask with name for basic info command test
Also add non-dummy URL in the test fixture, to match the name, version, etc. | Library/Homebrew/test/cask/cmd/home_spec.rb | @@ -16,7 +16,7 @@
it "works for multiple Casks" do
expect(described_class).to receive(:open_url).with("https://brew.sh/")
- expect(described_class).to receive(:open_url).with("https://brew.sh/")
+ expect(described_class).to receive(:open_url).with("https://transmissionbt.com/")
described_class.run(... | true |
Other | Homebrew | brew | efbfb90c42b6c106ab71c7a5340e05b81e7a133b.json | Use cask with name for basic info command test
Also add non-dummy URL in the test fixture, to match the name, version, etc. | Library/Homebrew/test/cask/cmd/info_spec.rb | @@ -10,16 +10,16 @@
it "displays some nice info about the specified Cask" do
expect {
- described_class.run("local-caffeine")
+ described_class.run("local-transmission")
}.to output(<<~EOS).to_stdout
- local-caffeine: 1.2.3
- https://brew.sh/
+ local-transmission: 2.61
+ htt... | true |
Other | Homebrew | brew | efbfb90c42b6c106ab71c7a5340e05b81e7a133b.json | Use cask with name for basic info command test
Also add non-dummy URL in the test fixture, to match the name, version, etc. | Library/Homebrew/test/cask/cmd/list_spec.rb | @@ -90,7 +90,7 @@
let(:casks) { ["local-caffeine", "local-transmission"] }
let(:expected_output) {
<<~EOS
- [{"token":"local-caffeine","name":[],"desc":null,"homepage":"https://brew.sh/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/caffeine.zip","appcast":null,"v... | true |
Other | Homebrew | brew | efbfb90c42b6c106ab71c7a5340e05b81e7a133b.json | Use cask with name for basic info command test
Also add non-dummy URL in the test fixture, to match the name, version, etc. | Library/Homebrew/test/support/fixtures/cask/Casks/local-transmission.rb | @@ -4,7 +4,7 @@
url "file://#{TEST_FIXTURE_DIR}/cask/transmission-2.61.dmg"
name "Transmission"
- homepage "https://brew.sh/"
+ homepage "https://transmissionbt.com/"
app "Transmission.app"
end | true |
Other | Homebrew | brew | ed23eb1fab44268a2ace3d5bafd2c45b38a6ce60.json | update repology for changes to GitHub module | Library/Homebrew/test/dev-cmd/bump_spec.rb | @@ -2,6 +2,19 @@
require "cmd/shared_examples/args_parse"
-describe "Homebrew.bump_args" do
- it_behaves_like "parseable arguments"
+describe "brew bump" do
+ describe "Homebrew.bump_args" do
+ it_behaves_like "parseable arguments"
+ end
+
+ describe "formula", :integration_test do
+ it "returns data for... | true |
Other | Homebrew | brew | ed23eb1fab44268a2ace3d5bafd2c45b38a6ce60.json | update repology for changes to GitHub module | Library/Homebrew/test/utils/repology_spec.rb | @@ -3,15 +3,10 @@
require "utils/repology"
describe Repology do
- describe "formula_data", :integration_test do
+ describe "formula_data" do
it "returns nil for invalid Homebrew Formula" do
expect(described_class.formula_data("invalidName")).to be_nil
end
-
- it "validates Homebrew Formula by ... | true |
Other | Homebrew | brew | ed23eb1fab44268a2ace3d5bafd2c45b38a6ce60.json | update repology for changes to GitHub module | Library/Homebrew/utils/repology.rb | @@ -63,7 +63,11 @@ def validate_and_format_packages(outdated_repology_packages, limit)
next if repology_homebrew_repo.blank?
- latest_version = repositories.find { |repo| repo["status"] == "newest" }["version"]
+ latest_version = repositories.find { |repo| repo["status"] == "newest" }
+
+ next... | true |
Other | Homebrew | brew | 05d03a3909b4ae6771d016409fdbe17f4eae4c80.json | remove duplicate methods | Library/Homebrew/utils/github.rb | @@ -346,27 +346,6 @@ def print_pull_requests_matching(query)
prs.each { |i| puts "#{i["title"]} (#{i["html_url"]})" }
end
- def fetch_pull_requests(query, tap_full_name, state: nil)
- issues_for_formula(query, tap_full_name: tap_full_name, state: state).select do |pr|
- pr["html_url"].include?("/pull... | false |
Other | Homebrew | brew | 0bf7773a0baef2c925b88445f84867e1ef3bc382.json | audit: add existing prerelease formulae to allowlist | Library/Homebrew/dev-cmd/audit.rb | @@ -684,8 +684,13 @@ def get_repo_data(regex)
}.freeze
GITHUB_PRERELEASE_ALLOWLIST = {
+ "cbmc" => "5.12.6",
+ "elm-format" => "0.8.3",
"gitless" => "0.8.8",
+ "infrakit" => "0.5",
+ "riff" => "0.5.0",
"telegram-cli" => "1.3.1",
+ "volta" ... | false |
Other | Homebrew | brew | f3283b60ccf1d18676bae7f90de7ab439d78ad09.json | utils/ruby.sh: test_ruby(): keep temporary variables local | Library/Homebrew/utils/ruby.sh | @@ -11,7 +11,9 @@ test_ruby () {
setup-ruby-path() {
local vendor_dir
+ local vendor_ruby_root
local vendor_ruby_path
+ local vendor_ruby_terminfo
local vendor_ruby_latest_version
local vendor_ruby_current_version
local usable_ruby | false |
Other | Homebrew | brew | ecbe2213e4ee19bb1b2ce434a7f9f0a2e56fa4dc.json | brew.sh: handle systems with no 'locale'
such as Alpine Linux
Closes Linuxbrew/docker#83 | Library/Homebrew/brew.sh | @@ -6,7 +6,10 @@ case "$HOMEBREW_SYSTEM" in
esac
# Force UTF-8 to avoid encoding issues for users with broken locale settings.
-if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]]
+if ! which locale &>/dev/null
+then
+ export LC_ALL=C
+elif [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]]
then
if [[ -n "$HOMEB... | false |
Other | Homebrew | brew | 1c10f51f9855076b541001b4b033800977d31a7b.json | audit: check GitHub tags for prerelease status | Library/Homebrew/dev-cmd/audit.rb | @@ -781,7 +781,7 @@ def audit_specs
return if stable_url_minor_version.even?
problem "#{stable.version} is a development release"
- when %r{^https://github.com/([\w-]+)/([\w-]+)/}
+ when %r{^https://github.com/([\w-]+)/([\w-]+)}
owner = Regexp.last_match(1)
repo = Regexp.... | false |
Other | Homebrew | brew | 8142bf2797e7411584e219255d0f849b3e9f0a90.json | rubocop/urls: add go@1.14 to binary URLs allowlist | Library/Homebrew/rubocops/urls.rb | @@ -35,6 +35,7 @@ class Urls < FormulaCop
go@1.11
go@1.12
go@1.13
+ go@1.14
haskell-stack
ldc
mlton | false |
Other | Homebrew | brew | ac6295491c771c0da2856524b8e7bb39f1f7da72.json | cmd/cleanup.rb: fix input handling | Library/Homebrew/cmd/cleanup.rb | @@ -33,6 +33,10 @@ def cleanup_args
def cleanup
args = cleanup_args.parse
+ if args.prune.present? && !Integer(args.prune, exception: false) && args.prune != "all"
+ raise UsageError, "--prune= expects an integer or 'all'."
+ end
+
cleanup = Cleanup.new(*args.named, dry_run: args.dry_run?, scr... | false |
Other | Homebrew | brew | 133155397c81a96612549d63b252821ba6c44ded.json | tests.yml: use proper matrix syntax
Co-authored-by: Bo Anderson <mail@boanderson.me> | .github/workflows/tests.yml | @@ -9,7 +9,7 @@ env:
jobs:
tests:
if: github.repository == 'Homebrew/brew'
- runs-on: ${{ matrix.os }}
+ runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
@@ -96,14 +96,14 @@ jobs:
- name: Run brew readall on all taps
run: brew readall --aliases
- - name: Ru... | false |
Other | Homebrew | brew | e9b6a6df4bd6d04ecef771102c7ab257b0ac3079.json | test/pkg_version_spec: add version token examples | Library/Homebrew/test/pkg_version_spec.rb | @@ -85,4 +85,46 @@
expect(p1.hash).not_to eq(p4.hash)
end
end
+
+ describe "#version" do
+ it "returns package version" do
+ expect(described_class.parse("1.2.3_4").version).to be == Version.create("1.2.3")
+ end
+ end
+
+ describe "#revision" do
+ it "returns package revision" do
+ ... | false |
Other | Homebrew | brew | e27f7b0ed101608fbcb5e36e3cef77f3ffbda40d.json | audit: use version token helper methods | Library/Homebrew/dev-cmd/audit.rb | @@ -261,9 +261,8 @@ def audit_file
!(versioned_formulae = formula.versioned_formulae).empty?
versioned_aliases = formula.aliases.grep(/.@\d/)
_, last_alias_version = versioned_formulae.map(&:name).last.split("@")
- major, minor, = formula.version.to_s.split(".")
- alias_name... | false |
Other | Homebrew | brew | f2112d67618fdff48dc6bba410c08e337f81774b.json | version: add helper methods to Token class | Library/Homebrew/version.rb | @@ -46,6 +46,18 @@ def inspect
"#<#{self.class.name} #{value.inspect}>"
end
+ def hash
+ value.hash
+ end
+
+ def to_f
+ value.to_f
+ end
+
+ def to_i
+ value.to_i
+ end
+
def to_s
value.to_s
end
@@ -75,6 +87,10 @@ def <=>(other)
end
end
+ ... | false |
Other | Homebrew | brew | 919e94bb9273a48ade57a2be184e9c3ee5e8dc07.json | test/version_spec: add major/minor/patch examples | Library/Homebrew/test/version_spec.rb | @@ -276,6 +276,76 @@
expect(v2.to_str).to eq("HEAD-ffffff")
end
+ describe "#major" do
+ it "returns major version token" do
+ expect(described_class.create("1").major).to be == Version::Token.create("1")
+ expect(described_class.create("1.2").major).to be == Version::Token.create("1")
+ ex... | false |
Other | Homebrew | brew | 03c83749c5fdf47436f5a1d2c94a20e6b9ae9540.json | reinstall: fix error when building from source
Fixes Homebrew/homebrew-core#59437. | Library/Homebrew/reinstall.rb | @@ -23,8 +23,11 @@ def reinstall_formula(f, build_from_source: false, args:)
options |= f.build.used_options
options &= f.options
+ build_from_source_formulae = args.build_from_source_formulae
+ build_from_source_formulae << f.full_name if build_from_source
+
fi = FormulaInstaller.new(f, force_bo... | false |
Other | Homebrew | brew | c7ce11963333802582b23ab946096df5e78429f0.json | sorbet: solve typecheck errors. 23 => 15 errors | Library/Homebrew/sorbet/rbi/cli.rbi | @@ -17,5 +17,21 @@ module Homebrew::CLI
def named_args; end
def force_bottle?; end
+
+ def debug?; end
+
+ def quiet?; end
+
+ def verbose?; end
+ end
+
+
+ class Parser
+ module Compat
+ include Kernel
+ module DeprecatedArgs
+ include Kernel
+ end
+ end
end
end | true |
Other | Homebrew | brew | c7ce11963333802582b23ab946096df5e78429f0.json | sorbet: solve typecheck errors. 23 => 15 errors | Library/Homebrew/sorbet/rbi/homebrew.rbi | @@ -20,6 +20,16 @@ module Dependable
def tags; end
end
+module DependenciesHelpers
+ include Kernel
+
+ module Compat
+ include Kernel
+
+ def args_includes_ignores(args); end
+ end
+end
+
class Formula
module Compat
include Kernel | true |
Other | Homebrew | brew | c7ce11963333802582b23ab946096df5e78429f0.json | sorbet: solve typecheck errors. 23 => 15 errors | Library/Homebrew/sorbet/rbi/utils/spdx.rbi | @@ -0,0 +1,11 @@
+# typed: strict
+
+module SPDX
+ include Kernel
+
+ def spdx_data; end
+
+ def download_latest_license_data!(to: JSON_PATH); end
+
+ def curl_download(*args, to: nil, partial: true, **options); end
+end | true |
Other | Homebrew | brew | 183d76d59ed3938cea105fde7351c85e4994617f.json | Add tests for livecheck_formula utils | Library/Homebrew/test/utils/livecheck_formula_spec.rb | @@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+require "utils/livecheck_formula"
+
+describe LivecheckFormula do
+ describe "init", :integration_test do
+ it "runs livecheck command for Formula" do
+ install_test_formula "testball"
+
+ formatted_response = described_class.init("testball")
+
+ ... | false |
Other | Homebrew | brew | 7409bae0b8e37f4f4b39f0ae0588ed44a1c9fc97.json | sorbet/files.yaml: add new files, 18 => 23 errors.
Add new files to the list of all files in sorbet/files.yaml.
following 8 files are added to false:
- ./cmd/--caskroom.rb
- ./rubocops/cask/mixin/on_desc_stanza.rb
- ./rubocops/shared/desc_helper.rb
- ./rubocops/shared/helper_functions.rb
- ./test/cmd/--caskr... | Library/Homebrew/sorbet/files.yaml | @@ -82,6 +82,7 @@ false:
- ./cleanup.rb
- ./cli/parser.rb
- ./cmd/--cache.rb
+ - ./cmd/--caskroom.rb
- ./cmd/--cellar.rb
- ./cmd/--env.rb
- ./cmd/--prefix.rb
@@ -489,9 +490,12 @@ false:
- ./rubocops/cask/homepage_matches_url.rb
- ./rubocops/cask/homepage_url_trailing_slash.rb
- ./rubocops/ca... | false |
Other | Homebrew | brew | f345f554c898748967a0b7768387d88eaa03176d.json | update-license-data: fix latest_tag error
Add latest_tag method to utils/spdx | Library/Homebrew/dev-cmd/update-license-data.rb | @@ -35,6 +35,6 @@ def update_license_data
ohai "git add"
safe_system "git", "add", SPDX::JSON_PATH
ohai "git commit"
- system "git", "commit", "--message", "data/spdx.json: update to #{latest_tag}"
+ system "git", "commit", "--message", "data/spdx.json: update to #{SPDX.latest_tag}"
end
end | true |
Other | Homebrew | brew | f345f554c898748967a0b7768387d88eaa03176d.json | update-license-data: fix latest_tag error
Add latest_tag method to utils/spdx | Library/Homebrew/utils/spdx.rb | @@ -12,8 +12,11 @@ def spdx_data
@spdx_data ||= JSON.parse(JSON_PATH.read)
end
+ def latest_tag
+ @latest_tag ||= GitHub.open_api(API_URL)["tag_name"]
+ end
+
def download_latest_license_data!(to: JSON_PATH)
- latest_tag = GitHub.open_api(API_URL)["tag_name"]
data_url = "https://raw.githubuser... | true |
Other | Homebrew | brew | 549cd5b47121e2b7b065c119eec80446b9658439.json | Ensure new casks have a description. | Library/Homebrew/cask/audit.rb | @@ -13,7 +13,7 @@ class Audit
attr_reader :cask, :commit_range, :download
- attr_predicate :appcast?
+ attr_predicate :appcast?, :new_cask?, :strict?, :online?
def initialize(cask, appcast: false, download: false, quarantine: nil,
token_conflicts: false, online: false, strict: ... | true |
Other | Homebrew | brew | 549cd5b47121e2b7b065c119eec80446b9658439.json | Ensure new casks have a description. | Library/Homebrew/test/cask/audit_spec.rb | @@ -33,12 +33,14 @@ def include_msg?(messages, msg)
let(:download) { false }
let(:token_conflicts) { false }
let(:strict) { false }
+ let(:new_cask) { false }
let(:fake_system_command) { class_double(SystemCommand) }
let(:audit) {
described_class.new(cask, download: download,
... | true |
Other | Homebrew | brew | 677714d801969aedc57ab01d9ad395ef3bbba11e.json | utils/pypi: add cdk8s to blocklist | Library/Homebrew/utils/pypi.rb | @@ -8,6 +8,7 @@ module PyPI
AUTOMATIC_RESOURCE_UPDATE_BLOCKLIST = %w[
ansible
ansible@2.8
+ cdk8s
cloudformation-cli
diffoscope
dxpy | false |
Other | Homebrew | brew | 6a98b235756c8b3803bd99af0be920990ad6030b.json | bundler: use 1.17.2 again.
This was what is included with macOS system Ruby 2.6.3. | Library/Homebrew/Gemfile.lock | @@ -168,4 +168,4 @@ DEPENDENCIES
tapioca
BUNDLED WITH
- 1.17.3
+ 1.17.2 | true |
Other | Homebrew | brew | 6a98b235756c8b3803bd99af0be920990ad6030b.json | bundler: use 1.17.2 again.
This was what is included with macOS system Ruby 2.6.3. | Library/Homebrew/utils/gems.rb | @@ -8,7 +8,7 @@
module Homebrew
# Keep in sync with the Gemfile.lock's BUNDLED WITH.
- HOMEBREW_BUNDLER_VERSION = "1.17.3"
+ HOMEBREW_BUNDLER_VERSION = "1.17.2"
module_function
| true |
Other | Homebrew | brew | 8b55f8f9a44a6f7acc0bfda6ee1708566b1f461e.json | version: detect versions with final/full suffix | Library/Homebrew/test/version_spec.rb | @@ -671,6 +671,27 @@
.to be_detected_from("https://ftpmirror.gnu.org/libidn/libidn-1.29-win64.zip")
end
+ specify "breseq version style" do
+ expect(described_class.create("0.35.1"))
+ .to be_detected_from(
+ "https://github.com/barricklab/breseq" \
+ "/releases/download... | true |
Other | Homebrew | brew | 8b55f8f9a44a6f7acc0bfda6ee1708566b1f461e.json | version: detect versions with final/full suffix | Library/Homebrew/version.rb | @@ -301,7 +301,7 @@ def self._parse(spec)
# e.g. foobar-4.5.1-1
# e.g. unrtf_0.20.4-1
# e.g. ruby-1.9.1-p243
- m = /[-_]((?:\d+\.)*\d+\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem)
+ m = /[-_]((?:\d+\.)*\d+\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?i:bin|dist|stable|src|sources?... | true |
Other | Homebrew | brew | 3b86e1f9c1931e5337a4d27a67f569f8679689bb.json | Implement RuboCop for cask `desc` stanza. | Library/.rubocop_cask.yml | @@ -1,5 +1,9 @@
inherit_from: ./Homebrew/.rubocop.yml
+Cask/Desc:
+ Description: 'Ensure that the desc stanza conforms to various content and style checks.'
+ Enabled: true
+
Cask/HomepageMatchesUrl:
Description: 'Ensure that the homepage and url match, otherwise add a comment. More info at https://github.com/... | true |
Other | Homebrew | brew | 3b86e1f9c1931e5337a4d27a67f569f8679689bb.json | Implement RuboCop for cask `desc` stanza. | Library/Homebrew/rubocops/cask/ast/cask_header.rb | @@ -29,7 +29,13 @@ def preferred_header_str
end
def cask_token
- @cask_token ||= pair_node.val_node.children.first
+ @cask_token ||= begin
+ if dsl_version?
+ pair_node.val_node.children.first
+ else
+ method_node.first_argument.str_c... | true |
Other | Homebrew | brew | 3b86e1f9c1931e5337a4d27a67f569f8679689bb.json | Implement RuboCop for cask `desc` stanza. | Library/Homebrew/rubocops/cask/desc.rb | @@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require "forwardable"
+require "uri"
+require "rubocops/cask/mixin/on_desc_stanza"
+require "rubocops/shared/desc_helper"
+
+module RuboCop
+ module Cop
+ module Cask
+ # This cop audits `desc` in Casks.
+ # See the `DescHelper` module for details of the ... | true |
Other | Homebrew | brew | 3b86e1f9c1931e5337a4d27a67f569f8679689bb.json | Implement RuboCop for cask `desc` stanza. | Library/Homebrew/rubocops/cask/mixin/on_desc_stanza.rb | @@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module RuboCop
+ module Cop
+ module Cask
+ # Common functionality for checking desc stanzas.
+ module OnDescStanza
+ extend Forwardable
+ include CaskHelp
+
+ def on_cask(cask_block)
+ @cask_block = cask_block
+
+ t... | true |
Other | Homebrew | brew | 3b86e1f9c1931e5337a4d27a67f569f8679689bb.json | Implement RuboCop for cask `desc` stanza. | Library/Homebrew/rubocops/rubocop-cask.rb | @@ -11,6 +11,7 @@
require "rubocops/cask/extend/node"
require "rubocops/cask/mixin/cask_help"
require "rubocops/cask/mixin/on_homepage_stanza"
+require "rubocops/cask/desc"
require "rubocops/cask/homepage_matches_url"
require "rubocops/cask/homepage_url_trailing_slash"
require "rubocops/cask/no_dsl_version" | true |
Other | Homebrew | brew | 3b86e1f9c1931e5337a4d27a67f569f8679689bb.json | Implement RuboCop for cask `desc` stanza. | Library/Homebrew/test/rubocops/cask/desc_spec.rb | @@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+require "rubocops/rubocop-cask"
+require "test/rubocops/cask/shared_examples/cask_cop"
+
+describe RuboCop::Cop::Cask::Desc do
+ include CaskCop
+
+ subject(:cop) { described_class.new }
+
+ context "with incorrect `desc` stanza" do
+ let(:source) {
+ <<~RUB... | true |
Other | Homebrew | brew | 3b86e1f9c1931e5337a4d27a67f569f8679689bb.json | Implement RuboCop for cask `desc` stanza. | Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb | @@ -8,31 +8,27 @@
subject(:cop) { described_class.new }
- context "with header method `cask`" do
- let(:header_method) { "cask" }
+ context "with no dsl version" do
+ let(:source) { "cask 'foo' do; end" }
- context "with no dsl version" do
- let(:source) { "cask 'foo' do; end" }
+ include_ex... | true |
Other | Homebrew | brew | ffed8fdbb3855fdae0dbef464cfcf68b26b84436.json | Add a `desc` stanza to the cask DSL | Library/Homebrew/cask/cask.rb | @@ -155,6 +155,7 @@ def to_h
{
"token" => token,
"name" => name,
+ "desc" => desc,
"homepage" => homepage,
"url" => url,
"appcast" => appcast, | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.