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 | e74e265e1da8a588895a8dfed4c685547b1b85ce.json | sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -27089,6 +27089,11 @@ class RuboCop::Cop::FormulaCop
def required_dependency_name?(param0, param1); end
end
+class RuboCop::Cop::Style::UnlessMultipleConditions
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
module RuboCop::RSpec::ExpectOffense
def expect_correction(correction, loop: T.unsafe(nil), source: T.unsafe(nil)); end
| false |
Other | Homebrew | brew | 1d576d2754999c6ca0b14ee096eeecc99374d8c8.json | shims/super/cc: fix most style errors | Library/Homebrew/shims/super/cc | @@ -30,19 +30,19 @@ class Cmd
def initialize(arg0, args)
@arg0 = arg0
@args = args.freeze
- @config = ENV.fetch("HOMEBREW_CCCFG") { "" }
+ @config = ENV.fetch("HOMEBREW_CCCFG", "")
@prefix = ENV["HOMEBREW_PREFIX"]
@cellar = ENV["HOMEBREW_CELLAR"]
@cachedir = ENV["HOMEBREW_CACHE"]
@opt = ENV["HOMEBREW_OPT"]
@tmpdir = ENV["HOMEBREW_TEMP"]
@sysroot = ENV["HOMEBREW_SDKROOT"]
- @archflags = ENV.fetch("HOMEBREW_ARCHFLAGS") { "" }.split(" ")
- @optflags = ENV.fetch("HOMEBREW_OPTFLAGS") { "" }.split(" ")
- @deps = Set.new(ENV.fetch("HOMEBREW_DEPENDENCIES") { "" }.split(","))
+ @archflags = ENV.fetch("HOMEBREW_ARCHFLAGS", "").split
+ @optflags = ENV.fetch("HOMEBREW_OPTFLAGS", "").split
+ @deps = Set.new(ENV.fetch("HOMEBREW_DEPENDENCIES", "").split(","))
@formula_prefix = ENV["HOMEBREW_FORMULA_PREFIX"]
# matches opt or cellar prefix and formula name
- @keg_regex = %r[(#{Regexp.escape(opt)}|#{Regexp.escape(cellar)})/([\w+-.@]+)]
+ @keg_regex = %r{(#{Regexp.escape(opt)}|#{Regexp.escape(cellar)})/([\w+-.@]+)}
end
def mode
@@ -51,7 +51,7 @@ class Cmd
elsif ["ld", "ld.gold", "gold"].include? @arg0
:ld
elsif @args.include? "-c"
- if @arg0 =~ /(?:c|g|clang)\+\+/
+ if /(?:c|g|clang)\+\+/.match?(@arg0)
:cxx
else
:cc
@@ -60,12 +60,10 @@ class Cmd
:cxx
elsif @args.include? "-E"
:ccE
+ elsif /(?:c|g|clang)\+\+/.match?(@arg0)
+ :cxxld
else
- if @arg0 =~ /(?:c|g|clang)\+\+/
- :cxxld
- else
- :ccld
- end
+ :ccld
end
end
@@ -75,15 +73,15 @@ class Cmd
when "gold", "ld.gold" then "ld.gold"
when "cpp" then "cpp"
when /llvm_(clang(\+\+)?)/
- "#{ENV["HOMEBREW_PREFIX"]}/opt/llvm/bin/#{$1}"
+ "#{ENV["HOMEBREW_PREFIX"]}/opt/llvm/bin/#{Regexp.last_match(1)}"
when /\w\+\+(-\d+(\.\d)?)?$/
case ENV["HOMEBREW_CC"]
when /clang/
"clang++"
when /llvm-gcc/
"llvm-g++-4.2"
when /(g)?cc(-\d+(\.\d)?)?$/
- "g++" + $2.to_s
+ "g++#{Regexp.last_match(2)}"
end
else
# Note that this is a universal fallback, so that we'll always invoke
@@ -104,10 +102,10 @@ class Cmd
return @args.dup
end
- if !refurbish_args? || tool == "ld" || configure?
- args = @args.dup
+ args = if !refurbish_args? || tool == "ld" || configure?
+ @args.dup
else
- args = refurbished_args
+ refurbished_args
end
if sysroot
@@ -189,10 +187,12 @@ class Cmd
# used for -Xpreprocessor -fopenmp
args << arg << enum.next
when /-mmacosx-version-min=(\d+)\.(\d+)/
- arg = "-mmacosx-version-min=10.9" if high_sierra_or_later? && $1 == "10" && $2.to_i < 9
+ if high_sierra_or_later? && Regexp.last_match(1) == "10" && Regexp.last_match(2).to_i < 9
+ arg = "-mmacosx-version-min=10.9"
+ end
args << arg
when "--fast-math"
- arg = "-ffast-math" if tool =~ /^clang/
+ arg = "-ffast-math" if /^clang/.match?(tool)
args << arg
when "-Wno-deprecated-register"
# older gccs don't support these flags
@@ -221,11 +221,11 @@ class Cmd
args << "-Wl,#{arg}"
when /^-I(.+)?/
# Support both "-Ifoo" (one argument) and "-I foo" (two arguments)
- val = chuzzle($1) || enum.next
+ val = chuzzle(Regexp.last_match(1)) || enum.next
path = canonical_path(val)
args << "-I#{val}" if keep?(path) && @iset.add?(path)
when /^-L(.+)?/
- val = chuzzle($1) || enum.next
+ val = chuzzle(Regexp.last_match(1)) || enum.next
path = canonical_path(val)
args << "-L#{val}" if keep?(path) && @lset.add?(path)
else
@@ -264,14 +264,14 @@ class Cmd
def cflags
args = []
- return args unless refurbish_args? || configure?
+ return args if !refurbish_args? && !configure?
args << "-pipe"
args << "-w" unless configure?
args << "-#{ENV["HOMEBREW_OPTIMIZATION_LEVEL"]}"
args.concat(optflags)
args.concat(archflags)
- args << "-std=#{@arg0}" if @arg0 =~ /c[89]9/
+ args << "-std=#{@arg0}" if /c[89]9/.match?(@arg0)
args
end
@@ -342,7 +342,7 @@ class Cmd
def system_library_paths
paths = ["#{sysroot}/usr/lib"]
- paths << "/usr/local/lib" unless sysroot || ENV["SDKROOT"]
+ paths << "/usr/local/lib" if !sysroot && !ENV["SDKROOT"]
paths
end
@@ -393,11 +393,12 @@ class Cmd
end
def path_split(key)
- ENV.fetch(key) { "" }.split(File::PATH_SEPARATOR)
+ ENV.fetch(key, "").split(File::PATH_SEPARATOR)
end
def chuzzle(val)
return val if val.nil?
+
val = val.chomp
return val unless val.empty?
end
@@ -435,15 +436,15 @@ if __FILE__ == $PROGRAM_NAME
####################################################################### main
- dirname, basename = File.split($0)
+ dirname, basename = File.split($PROGRAM_NAME)
cmd = Cmd.new(basename, ARGV)
tool = cmd.tool
args = cmd.args
log(basename, ARGV, tool, args)
- args << { :close_others => false }
+ args << { close_others: false }
if mac?
exec "#{dirname}/xcrun", tool, *args
else | false |
Other | Homebrew | brew | 17c25980f97e6f8176a5fa05ff7d4a207a7a09de.json | Governance: Accept suggestions of Rylan
Change "majority vote" to "ordinary resolution".
Change "Project Leadership Committee" to "PLC".
Add "with compromise". | docs/Homebrew-Governance.md | @@ -10,13 +10,13 @@
## 2. Members
-1. New members will be admitted by majority vote of the Project Leadership Committee (PLC) and added to the Homebrew organisation on GitHub.
+1. New members will be admitted by an ordinary resolution of the PLC and added to the Homebrew organisation on GitHub.
2. Members may vote in all general elections and resolutions, hold office for Homebrew, and participate in all other membership functions.
3. Members are expected to remain active within Homebrew, and are required to affirm their continued interest in Homebrew membership annually.
-4. Members may be dismissed by majority vote of the Project Leadership Committee and removed from the Homebrew organisation on GitHub. Removed members may be reinstated by the usual admission process.
+4. A member may be removed from Homebrew by an ordinary resolution of the PLC. A removed member may be reinstated by the usual admission process.
5. All members will follow the [Homebrew Code of Conduct](https://github.com/Homebrew/.github/blob/HEAD/CODE_OF_CONDUCT.md#code-of-conduct). Changes to the code of conduct must be approved by the PLC.
@@ -74,9 +74,9 @@
4. The PLC will meet annually to review the status of all members and remove inactive members and those who have not affirmed a commitment to Homebrew in the past year. Voting in the AGM confirms that a member wishes to remain active with the project. After the AGM, the PLC will ask the members who did not vote whether they wish to remain active with the project. The PLC removes any members who don't respond to this second request after three weeks.
-5. The PLC will appoint the members of the Technical Steering Committee (TSC).
+5. The PLC will appoint the members of the TSC.
-6. Any member may refer any question or dispute to the PLC. All technical matters should first be referred to the TSC. Non-technical matters may be referred directly to the PLC. Members will make a good faith effort to resolve any disputes prior to referral to the PLC.
+6. Any member may refer any question or dispute to the PLC. All technical matters should first be referred to the TSC. Non-technical matters may be referred directly to the PLC. Members will make a good faith effort to resolve any disputes with compromise prior to referral to the PLC.
7. The PLC may meet by any mutually agreeable means, such as text chat, voice or video call, and in person. Members of the PLC must meet at least once per quarter. Members of the PLC must meet by video call or in person at least once per year.
@@ -106,4 +106,4 @@
4. No more than two employees of the same employer may serve on the TSC.
-5. A member of the TSC, except the Project Leader, may be removed by an ordinary resolution of the PLC.
+5. A member of the TSC, except the Project Leader, may be removed from the TSC by an ordinary resolution of the PLC. | false |
Other | Homebrew | brew | 74787ca0eeb3a1d4c19420dced32c9f5965175b0.json | docs: update shell completions instructions | docs/Shell-Completion.md | @@ -4,7 +4,9 @@ Homebrew comes with completion definitions for the `brew` command. Some packages
`zsh`, `bash` and `fish` are currently supported.
-You must configure your shell to enable its completion support. This is because the Homebrew-managed completions are stored under `HOMEBREW_PREFIX` which your system shell may not be aware of, and since it is difficult to automatically configure `bash` and `zsh` completions in a robust manner, the Homebrew installer does not do it for you.
+Shell completions for built-in Homebrew commands are not automatically installed. To opt-in to using our completions, they need to be linked to `HOMEBREW_PREFIX` by running `brew completions link`.
+
+You must then configure your shell to enable its completion support. This is because the Homebrew-managed completions are stored under `HOMEBREW_PREFIX` which your system shell may not be aware of, and since it is difficult to automatically configure `bash` and `zsh` completions in a robust manner, the Homebrew installer does not do it for you.
## Configuring Completions in `bash`
| false |
Other | Homebrew | brew | 234267cc937dbd59ef1219537f5bd07e24ef4c7f.json | completions: make opt-in only | Library/Homebrew/cmd/completions.rb | @@ -0,0 +1,52 @@
+# typed: true
+# frozen_string_literal: true
+
+require "cli/parser"
+require "completions"
+
+module Homebrew
+ extend T::Sig
+
+ module_function
+
+ sig { returns(CLI::Parser) }
+ def completions_args
+ Homebrew::CLI::Parser.new do
+ usage_banner <<~EOS
+ `completions` [<subcommand>]
+
+ Control whether Homebrew automatically links shell files.
+ Read more at <https://docs.brew.sh/Shell-Completion>.
+
+ `brew completions` [`state`]:
+ Display the current state of Homebrew's completions.
+
+ `brew completions` (`link`|`unlink`):
+ Link or unlink Homebrew's completions.
+ EOS
+
+ max_named 1
+ end
+ end
+
+ def completions
+ args = completions_args.parse
+
+ case args.named.first
+ when nil, "state"
+ if Completions.link_completions?
+ puts "Completions are not linked."
+ else
+ puts "Completions are linked."
+ end
+ when "link"
+ Completions.link!
+ puts "Completions are now linked."
+ when "unlink"
+ Completions.unlink!
+ puts "Completions are no longer linked."
+ else
+ raise UsageError, "unknown subcommand: #{args.named.first}"
+ end
+ end
+end | true |
Other | Homebrew | brew | 234267cc937dbd59ef1219537f5bd07e24ef4c7f.json | completions: make opt-in only | Library/Homebrew/cmd/update-report.rb | @@ -8,6 +8,7 @@
require "cleanup"
require "description_cache_store"
require "cli/parser"
+require "completions"
module Homebrew
extend T::Sig
@@ -150,6 +151,15 @@ def update_report
puts "Already up-to-date." unless args.quiet?
end
+ if Completions.read_completions_option.empty?
+ ohai "Homebrew completions are unlinked by default!"
+ puts <<~EOS
+ To opt-in to automatically linking Homebrew shell competion files, run:
+ brew completions link
+ Then, follow the directions at #{Formatter.url("https://docs.brew.sh/Shell-Completion")}
+ EOS
+ end
+
Commands.rebuild_commands_completion_list
link_completions_manpages_and_docs
Tap.each(&:link_completions_and_manpages)
@@ -188,7 +198,8 @@ def install_core_tap_if_necessary
def link_completions_manpages_and_docs(repository = HOMEBREW_REPOSITORY)
command = "brew update"
- Utils::Link.link_completions(repository, command)
+
+ Completions.link_if_allowed! command: command
Utils::Link.link_manpages(repository, command)
Utils::Link.link_docs(repository, command)
rescue => e | true |
Other | Homebrew | brew | 234267cc937dbd59ef1219537f5bd07e24ef4c7f.json | completions: make opt-in only | Library/Homebrew/completions.rb | @@ -0,0 +1,53 @@
+# typed: true
+# frozen_string_literal: true
+
+require "utils/link"
+
+# Helper functions for generating shell completions.
+#
+# @api private
+module Completions
+ extend T::Sig
+
+ module_function
+
+ sig { params(command: String).void }
+ def link_if_allowed!(command: "brew completions link")
+ if link_completions?
+ link! command: command
+ else
+ unlink!
+ end
+ end
+
+ sig { params(command: String).void }
+ def link!(command: "brew completions link")
+ write_completions_option "yes"
+ Utils::Link.link_completions HOMEBREW_REPOSITORY, command
+ end
+
+ sig { void }
+ def unlink!
+ write_completions_option "no"
+ Utils::Link.unlink_completions HOMEBREW_REPOSITORY
+ end
+
+ sig { returns(T::Boolean) }
+ def link_completions?
+ read_completions_option == "yes"
+ end
+
+ sig { returns(String) }
+ def read_completions_option
+ HOMEBREW_REPOSITORY.cd do
+ Utils.popen_read("git", "config", "--get", "homebrew.linkcompletions").chomp
+ end
+ end
+
+ sig { params(state: String).void }
+ def write_completions_option(state)
+ HOMEBREW_REPOSITORY.cd do
+ T.unsafe(self).safe_system "git", "config", "--replace-all", "homebrew.linkcompletions", state.to_s
+ end
+ end
+end | true |
Other | Homebrew | brew | 234267cc937dbd59ef1219537f5bd07e24ef4c7f.json | completions: make opt-in only | Library/Homebrew/utils/link.rb | @@ -1,6 +1,8 @@
# typed: true
# frozen_string_literal: true
+require "completions"
+
module Utils
# Helper functions for creating symlinks.
#
@@ -64,6 +66,11 @@ def unlink_manpages(path)
end
def link_completions(path, command)
+ unless Completions.link_completions?
+ unlink_completions path
+ return
+ end
+
link_src_dst_dirs(path/"completions/bash", HOMEBREW_PREFIX/"etc/bash_completion.d", command)
link_src_dst_dirs(path/"completions/zsh", HOMEBREW_PREFIX/"share/zsh/site-functions", command)
link_src_dst_dirs(path/"completions/fish", HOMEBREW_PREFIX/"share/fish/vendor_completions.d", command) | true |
Other | Homebrew | brew | 234267cc937dbd59ef1219537f5bd07e24ef4c7f.json | completions: make opt-in only | completions/internal_commands_list.txt | @@ -25,6 +25,7 @@ cat
cleanup
command
commands
+completions
config
configure
create | true |
Other | Homebrew | brew | 234267cc937dbd59ef1219537f5bd07e24ef4c7f.json | completions: make opt-in only | docs/Manpage.md | @@ -94,6 +94,17 @@ Show lists of built-in and external commands.
* `--include-aliases`:
Include aliases of internal commands.
+### `completions` [*`subcommand`*]
+
+Control whether Homebrew automatically links shell files.
+Read more at <https://docs.brew.sh/Shell-Completion>.
+
+`brew completions` [`state`]
+<br>Display the current state of Homebrew's completions.
+
+`brew completions` (`link`|`unlink`)
+<br>Link or unlink Homebrew's completions.
+
### `config`
Show Homebrew and system configuration info useful for debugging. If you file | true |
Other | Homebrew | brew | 234267cc937dbd59ef1219537f5bd07e24ef4c7f.json | completions: make opt-in only | manpages/brew.1 | @@ -93,6 +93,17 @@ List only the names of commands without category headers\.
\fB\-\-include\-aliases\fR
Include aliases of internal commands\.
.
+.SS "\fBcompletions\fR [\fIsubcommand\fR]"
+Control whether Homebrew automatically links shell files\. Read more at \fIhttps://docs\.brew\.sh/Shell\-Completion\fR\.
+.
+.P
+\fBbrew completions\fR [\fBstate\fR]
+ Display the current state of Homebrew\'s completions\.
+.
+.P
+\fBbrew completions\fR (\fBlink\fR|\fBunlink\fR)
+ Link or unlink Homebrew\'s completions\.
+.
.SS "\fBconfig\fR"
Show Homebrew and system configuration info useful for debugging\. If you file a bug report, you will be required to provide this information\.
. | true |
Other | Homebrew | brew | 6472936f25192148bc8be232517bec2d2e124301.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.8.0.rbi | @@ -174,6 +174,7 @@ end
class RuboCop::CommentConfig
def initialize(processed_source); end
+ def comment_only_line?(line_number); end
def cop_disabled_line_ranges; end
def cop_enabled_at_line?(cop, line_number); end
def extra_enabled_comments; end
@@ -187,7 +188,6 @@ class RuboCop::CommentConfig
def analyze_disabled(analysis, line); end
def analyze_rest(analysis, line); end
def analyze_single_line(analysis, line, disabled); end
- def comment_only_line?(line_number); end
def cop_line_ranges(analysis); end
def directive_on_comment_line?(comment); end
def directive_parts(comment); end
@@ -632,6 +632,13 @@ class RuboCop::Cop::AlignmentCorrector
end
end
+module RuboCop::Cop::AllowedIdentifiers
+ def allowed_identifier?(name); end
+ def allowed_identifiers; end
+end
+
+RuboCop::Cop::AllowedIdentifiers::SIGILS = T.let(T.unsafe(nil), String)
+
module RuboCop::Cop::AllowedMethods
private
@@ -3474,9 +3481,9 @@ class RuboCop::Cop::Layout::SpaceBeforeBrackets < ::RuboCop::Cop::Base
private
- def offense_range(node, first_argument, begin_pos); end
+ def offense_range(node, begin_pos); end
+ def reference_variable_with_brackets?(node); end
def register_offense(range); end
- def space_before_brackets?(node, first_argument); end
end
RuboCop::Cop::Layout::SpaceBeforeBrackets::MSG = T.let(T.unsafe(nil), String)
@@ -4042,6 +4049,22 @@ RuboCop::Cop::Lint::DeprecatedClassMethods::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::DeprecatedClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Lint::DeprecatedConstants < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def on_const(node); end
+
+ private
+
+ def consntant_name(node, nested_constant_name); end
+ def deprecated_constants; end
+ def message(good, bad, deprecated_version); end
+end
+
+RuboCop::Cop::Lint::DeprecatedConstants::DO_NOT_USE_MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Lint::DeprecatedOpenSSLConstant < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
@@ -4516,6 +4539,16 @@ end
RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Lint::LambdaWithoutLiteralBlock < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def on_send(node); end
+end
+
+RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Lint::LambdaWithoutLiteralBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Lint::LiteralAsCondition < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
@@ -4937,6 +4970,19 @@ end
RuboCop::Cop::Lint::RedundantCopEnableDirective::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Lint::RedundantDirGlobSort < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::AutoCorrector)
+ extend(::RuboCop::Cop::TargetRubyVersion)
+
+ def on_send(node); end
+end
+
+RuboCop::Cop::Lint::RedundantDirGlobSort::GLOB_METHODS = T.let(T.unsafe(nil), Array)
+
+RuboCop::Cop::Lint::RedundantDirGlobSort::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Lint::RedundantDirGlobSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Lint::RedundantRequireStatement < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
@@ -6365,6 +6411,7 @@ end
RuboCop::Cop::Naming::RescuedExceptionsVariableName::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Naming::VariableName < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::AllowedIdentifiers)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::ConfigurableFormatting)
include(::RuboCop::Cop::ConfigurableNaming)
@@ -6389,6 +6436,7 @@ end
RuboCop::Cop::Naming::VariableName::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Naming::VariableNumber < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::AllowedIdentifiers)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::ConfigurableFormatting)
include(::RuboCop::Cop::ConfigurableNumbering)
@@ -6403,8 +6451,6 @@ class RuboCop::Cop::Naming::VariableNumber < ::RuboCop::Cop::Base
private
- def allowed_identifier?(name); end
- def allowed_identifiers; end
def message(style); end
end
@@ -8011,6 +8057,27 @@ end
RuboCop::Cop::Style::EndBlock::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Style::EndlessMethod < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::ConfigurableEnforcedStyle)
+ extend(::RuboCop::Cop::TargetRubyVersion)
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def on_def(node); end
+
+ private
+
+ def arguments(node, missing = T.unsafe(nil)); end
+ def correct_to_multiline(corrector, node); end
+ def handle_allow_style(node); end
+ def handle_disallow_style(node); end
+end
+
+RuboCop::Cop::Style::EndlessMethod::CORRECTION_STYLES = T.let(T.unsafe(nil), Array)
+
+RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base
def eval_without_location?(param0 = T.unsafe(nil)); end
def line_with_offset?(param0 = T.unsafe(nil), param1, param2); end
@@ -8459,6 +8526,7 @@ class RuboCop::Cop::Style::IfInsideElse < ::RuboCop::Cop::Base
def autocorrect(corrector, node); end
def correct_to_elsif_from_if_inside_else_form(corrector, node, condition); end
def correct_to_elsif_from_modifier_form(corrector, node); end
+ def find_end_range(node); end
end
RuboCop::Cop::Style::IfInsideElse::MSG = T.let(T.unsafe(nil), String)
@@ -8738,6 +8806,10 @@ class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base
def args_begin(node); end
def args_end(node); end
def args_parenthesized?(node); end
+
+ class << self
+ def autocorrect_incompatible_with; end
+ end
end
module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
@@ -9199,6 +9271,10 @@ class RuboCop::Cop::Style::NestedParenthesizedCalls < ::RuboCop::Cop::Base
def allowed?(send_node); end
def allowed_omission?(send_node); end
def autocorrect(corrector, nested); end
+
+ class << self
+ def autocorrect_incompatible_with; end
+ end
end
RuboCop::Cop::Style::NestedParenthesizedCalls::MSG = T.let(T.unsafe(nil), String)
@@ -10473,6 +10549,9 @@ class RuboCop::Cop::Style::SingleLineMethods < ::RuboCop::Cop::Base
def allow_empty?; end
def autocorrect(corrector, node); end
+ def correct_to_endless(corrector, node); end
+ def correct_to_endless?(body_node); end
+ def correct_to_multiline(corrector, node); end
def each_part(body); end
def move_comment(node, corrector); end
end
@@ -12630,11 +12709,15 @@ class RuboCop::TargetRuby::RubyVersionFile < ::RuboCop::TargetRuby::Source
private
+ def filename; end
def find_version; end
- def ruby_version_file; end
+ def pattern; end
+ def version_file; end
end
-RuboCop::TargetRuby::RubyVersionFile::FILENAME = T.let(T.unsafe(nil), String)
+RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_FILENAME = T.let(T.unsafe(nil), String)
+
+RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp)
class RuboCop::TargetRuby::Source
def initialize(config); end
@@ -12644,6 +12727,19 @@ class RuboCop::TargetRuby::Source
def version; end
end
+class RuboCop::TargetRuby::ToolVersionsFile < ::RuboCop::TargetRuby::RubyVersionFile
+ def name; end
+
+ private
+
+ def filename; end
+ def pattern; end
+end
+
+RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_FILENAME = T.let(T.unsafe(nil), String)
+
+RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_PATTERN = T.let(T.unsafe(nil), Regexp)
+
RuboCop::Token = RuboCop::AST::Token
module RuboCop::Util | true |
Other | Homebrew | brew | 6472936f25192148bc8be232517bec2d2e124301.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/unicode-display_width@2.0.0.rbi | @@ -1,13 +1,18 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `unicode-display_width` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
+# Please instead update this file by running `tapioca sync`.
# typed: true
module Unicode
end
-module Unicode::DisplayWidth
+class Unicode::DisplayWidth
+ def initialize(ambiguous: T.unsafe(nil), overwrite: T.unsafe(nil), emoji: T.unsafe(nil)); end
+
+ def get_config(**kwargs); end
+ def of(string, **kwargs); end
+
class << self
def emoji_extra_width_of(string, ambiguous = T.unsafe(nil), overwrite = T.unsafe(nil), _ = T.unsafe(nil)); end
def of(string, ambiguous = T.unsafe(nil), overwrite = T.unsafe(nil), options = T.unsafe(nil)); end
@@ -22,8 +27,6 @@ Unicode::DisplayWidth::INDEX = T.let(T.unsafe(nil), Array)
Unicode::DisplayWidth::INDEX_FILENAME = T.let(T.unsafe(nil), String)
-Unicode::DisplayWidth::NO_STRING_EXT = T.let(T.unsafe(nil), TrueClass)
-
Unicode::DisplayWidth::UNICODE_VERSION = T.let(T.unsafe(nil), String)
Unicode::DisplayWidth::VERSION = T.let(T.unsafe(nil), String) | true |
Other | Homebrew | brew | 6472936f25192148bc8be232517bec2d2e124301.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -26570,7 +26570,6 @@ end
class Resource
include ::FileUtils::StreamUtils_
- def sha256(val); end
end
class Resource::Partial
@@ -30075,6 +30074,11 @@ module Utils::Svn
extend ::T::Private::Methods::SingletonMethodHooks
end
+module Utils
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
class Version::Token
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks | true |
Other | Homebrew | brew | cb5bf64f117ea3c5f1b7ce6902973bca7dfa9216.json | Update RBI files for nokogiri. | Library/Homebrew/sorbet/rbi/gems/nokogiri@1.11.1.rbi | @@ -596,6 +596,12 @@ Nokogiri::PRECOMPILED_LIBRARIES = T.let(T.unsafe(nil), TrueClass)
class Nokogiri::SyntaxError < ::StandardError
end
+module Nokogiri::Test
+ class << self
+ def __foreign_error_handler; end
+ end
+end
+
Nokogiri::VERSION = T.let(T.unsafe(nil), String)
Nokogiri::VERSION_INFO = T.let(T.unsafe(nil), Hash) | true |
Other | Homebrew | brew | cb5bf64f117ea3c5f1b7ce6902973bca7dfa9216.json | Update RBI files for nokogiri. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -13124,6 +13124,7 @@ class Object
CROSS_COMPILING = ::T.let(nil, ::T.untyped)
DEPRECATED_OFFICIAL_TAPS = ::T.let(nil, ::T.untyped)
ENV = ::T.let(nil, ::T.untyped)
+ FORMULA_COMPONENT_PRECEDENCE_LIST = ::T.let(nil, ::T.untyped)
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_DEFAULT_GIT_REMOTE = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_FILE = ::T.let(nil, ::T.untyped) | true |
Other | Homebrew | brew | 1810a1d6876689357d6dfb431da48976c49ecc51.json | Update RBI files for rubocop-ast. | Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.4.0.rbi | @@ -617,6 +617,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node
def ivasgn_type?; end
def keyword?; end
def kwarg_type?; end
+ def kwargs_type?; end
def kwbegin_type?; end
def kwnilarg_type?; end
def kwoptarg_type?; end
@@ -639,6 +640,8 @@ class RuboCop::AST::Node < ::Parser::AST::Node
def match_current_line_type?; end
def match_guard_clause?(param0 = T.unsafe(nil)); end
def match_nil_pattern_type?; end
+ def match_pattern_p_type?; end
+ def match_pattern_type?; end
def match_rest_type?; end
def match_var_type?; end
def match_with_lvasgn_type?; end
@@ -1584,8 +1587,6 @@ RuboCop::AST::NodePattern::Sets::SET__ = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET__AT_SLICE = T.let(T.unsafe(nil), Set)
-RuboCop::AST::NodePattern::Sets::SET__EQL_ = T.let(T.unsafe(nil), Set)
-
RuboCop::AST::NodePattern::Sets::SET__EQUAL_EQL = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET__GLOB = T.let(T.unsafe(nil), Set)
@@ -1606,6 +1607,8 @@ RuboCop::AST::NodePattern::Sets::SET___7 = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET___8 = T.let(T.unsafe(nil), Set)
+RuboCop::AST::NodePattern::Sets::SET___EQL = T.let(T.unsafe(nil), Set)
+
RuboCop::AST::NodePattern::Sets::SET___METHOD_____CALLEE__ = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET____ = T.let(T.unsafe(nil), Set)
@@ -1926,6 +1929,7 @@ module RuboCop::AST::Traversal
def on_ivar(node); end
def on_ivasgn(node); end
def on_kwarg(node); end
+ def on_kwargs(node); end
def on_kwbegin(node); end
def on_kwnilarg(node); end
def on_kwoptarg(node); end
@@ -1939,6 +1943,8 @@ module RuboCop::AST::Traversal
def on_match_as(node); end
def on_match_current_line(node); end
def on_match_nil_pattern(node); end
+ def on_match_pattern(node); end
+ def on_match_pattern_p(node); end
def on_match_rest(node); end
def on_match_var(node); end
def on_match_with_lvasgn(node); end | true |
Other | Homebrew | brew | 1810a1d6876689357d6dfb431da48976c49ecc51.json | Update RBI files for rubocop-ast. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -13124,6 +13124,7 @@ class Object
CROSS_COMPILING = ::T.let(nil, ::T.untyped)
DEPRECATED_OFFICIAL_TAPS = ::T.let(nil, ::T.untyped)
ENV = ::T.let(nil, ::T.untyped)
+ FORMULA_COMPONENT_PRECEDENCE_LIST = ::T.let(nil, ::T.untyped)
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_DEFAULT_GIT_REMOTE = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_FILE = ::T.let(nil, ::T.untyped)
@@ -27690,12 +27691,6 @@ class RuboCop::AST::Node
def key_node(param0=T.unsafe(nil)); end
- def kwargs_type?(); end
-
- def match_pattern_p_type?(); end
-
- def match_pattern_type?(); end
-
def method_node(param0=T.unsafe(nil)); end
def val_node(param0=T.unsafe(nil)); end
@@ -27711,15 +27706,6 @@ module RuboCop::AST::NodePattern::Sets
SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped)
SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
- SET___EQL = ::T.let(nil, ::T.untyped)
-end
-
-module RuboCop::AST::Traversal
- def on_kwargs(node); end
-
- def on_match_pattern(node); end
-
- def on_match_pattern_p(node); end
end
class RuboCop::Cask::AST::CaskHeader | true |
Other | Homebrew | brew | 4886b3b13845c8c76ebefd1a586a367961eab427.json | github: check token scopes even if authorized | Library/Homebrew/utils/github.rb | @@ -141,9 +141,8 @@ def api_credentials_type
def api_credentials_error_message(response_headers, needed_scopes)
return if response_headers.empty?
- unauthorized = (response_headers["http/1.1"] == "401 Unauthorized")
scopes = response_headers["x-accepted-oauth-scopes"].to_s.split(", ")
- return unless unauthorized && scopes.blank?
+ return if scopes.present?
needed_human_scopes = needed_scopes.join(", ")
credentials_scopes = response_headers["x-oauth-scopes"] | false |
Other | Homebrew | brew | d2fe763ec37f147e00364b1e4a46ef60af554041.json | sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -13124,6 +13124,7 @@ class Object
CROSS_COMPILING = ::T.let(nil, ::T.untyped)
DEPRECATED_OFFICIAL_TAPS = ::T.let(nil, ::T.untyped)
ENV = ::T.let(nil, ::T.untyped)
+ FORMULA_COMPONENT_PRECEDENCE_LIST = ::T.let(nil, ::T.untyped)
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_DEFAULT_GIT_REMOTE = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_FILE = ::T.let(nil, ::T.untyped) | false |
Other | Homebrew | brew | 02c207a9ec6ccec1899cf8428a05bb2682235f90.json | git_repository: replace compound `unless` with equivalent `if` | Library/Homebrew/extend/git_repository.rb | @@ -18,56 +18,56 @@ def git?
# Gets the URL of the Git origin remote.
sig { returns(T.nilable(String)) }
def git_origin
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
Utils.popen_read("git", "config", "--get", "remote.origin.url", chdir: self).chomp.presence
end
# Sets the URL of the Git origin remote.
sig { params(origin: String).returns(T.nilable(T::Boolean)) }
def git_origin=(origin)
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
safe_system "git", "remote", "set-url", "origin", origin, chdir: self
end
# Gets the full commit hash of the HEAD commit.
sig { returns(T.nilable(String)) }
def git_head
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
Utils.popen_read("git", "rev-parse", "--verify", "-q", "HEAD", chdir: self).chomp.presence
end
# Gets a short commit hash of the HEAD commit.
sig { params(length: T.nilable(Integer)).returns(T.nilable(String)) }
- def git_short_head(length: 4)
- return unless git? && Utils::Git.available?
+ def git_short_head(length: nil)
+ return if !git? || !Utils::Git.available?
- Utils.popen_read("git", "rev-parse", "--short#{length&.to_s&.prepend("=")}",
- "--verify", "-q", "HEAD", chdir: self).chomp.presence
+ short_arg = length&.to_s&.prepend("=")
+ Utils.popen_read("git", "rev-parse", "--short#{short_arg}", "--verify", "-q", "HEAD", chdir: self).chomp.presence
end
# Gets the relative date of the last commit, e.g. "1 hour ago"
sig { returns(T.nilable(String)) }
def git_last_commit
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
Utils.popen_read("git", "show", "-s", "--format=%cr", "HEAD", chdir: self).chomp.presence
end
# Gets the name of the currently checked-out branch, or HEAD if the repository is in a detached HEAD state.
sig { returns(T.nilable(String)) }
def git_branch
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
Utils.popen_read("git", "rev-parse", "--abbrev-ref", "HEAD", chdir: self).chomp.presence
end
# Gets the name of the default origin HEAD branch.
sig { returns(T.nilable(String)) }
def git_origin_branch
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
Utils.popen_read("git", "symbolic-ref", "-q", "--short", "refs/remotes/origin/HEAD", chdir: self)
.chomp.presence&.split("/")&.last
@@ -82,15 +82,15 @@ def git_default_origin_branch?
# Returns the date of the last commit, in YYYY-MM-DD format.
sig { returns(T.nilable(String)) }
def git_last_commit_date
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
Utils.popen_read("git", "show", "-s", "--format=%cd", "--date=short", "HEAD", chdir: self).chomp.presence
end
# Gets the full commit message of the specified commit, or of the HEAD commit if unspecified.
sig { params(commit: String).returns(T.nilable(String)) }
def git_commit_message(commit = "HEAD")
- return unless git? && Utils::Git.available?
+ return if !git? || !Utils::Git.available?
Utils.popen_read("git", "log", "-1", "--pretty=%B", commit, "--", chdir: self, err: :out).strip.presence
end | true |
Other | Homebrew | brew | 02c207a9ec6ccec1899cf8428a05bb2682235f90.json | git_repository: replace compound `unless` with equivalent `if` | Library/Homebrew/tap.rb | @@ -172,7 +172,7 @@ def git_head
def git_short_head
raise TapUnavailableError, name unless installed?
- path.git_short_head
+ path.git_short_head(length: 4)
end
# Time since last git commit for this {Tap}. | true |
Other | Homebrew | brew | 1395259ad67c29c353ad0528bdc297d1bb2d39ab.json | bump-*-pr: check existing PRs for exact file match | Library/Homebrew/dev-cmd/bump-cask-pr.rb | @@ -200,13 +200,10 @@ def fetch_resource(cask, new_version, url, **specs)
end
def check_open_pull_requests(cask, tap_full_name, args:)
- GitHub.check_for_duplicate_pull_requests(cask.token, tap_full_name, state: "open", args: args)
- end
-
- def check_closed_pull_requests(cask, tap_full_name, version:, args:)
- # if we haven't already found open requests, try for an exact match across closed requests
- pr_title = "Update #{cask.token} from #{cask.version} to #{version}"
- GitHub.check_for_duplicate_pull_requests(pr_title, tap_full_name, state: "closed", args: args)
+ GitHub.check_for_duplicate_pull_requests(cask.token, tap_full_name,
+ state: "open",
+ file: cask.sourcefile_path.relative_path_from(cask.tap.path).to_s,
+ args: args)
end
def run_cask_audit(cask, old_contents, args:) | true |
Other | Homebrew | brew | 1395259ad67c29c353ad0528bdc297d1bb2d39ab.json | bump-*-pr: check existing PRs for exact file match | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -460,7 +460,10 @@ def formula_version(formula, spec, contents = nil)
end
def check_open_pull_requests(formula, tap_full_name, args:)
- GitHub.check_for_duplicate_pull_requests(formula.name, tap_full_name, state: "open", args: args)
+ GitHub.check_for_duplicate_pull_requests(formula.name, tap_full_name,
+ state: "open",
+ file: formula.path.relative_path_from(formula.tap.path).to_s,
+ args: args)
end
def check_closed_pull_requests(formula, tap_full_name, args:, version: nil, url: nil, tag: nil)
@@ -470,7 +473,10 @@ def check_closed_pull_requests(formula, tap_full_name, args:, version: nil, url:
version = Version.detect(url, **specs)
end
# if we haven't already found open requests, try for an exact match across closed requests
- GitHub.check_for_duplicate_pull_requests("#{formula.name} #{version}", tap_full_name, state: "closed", args: args)
+ GitHub.check_for_duplicate_pull_requests("#{formula.name} #{version}", tap_full_name,
+ state: "closed",
+ file: formula.path.relative_path_from(formula.tap.path).to_s,
+ args: args)
end
def alias_update_pair(formula, new_formula_version) | true |
Other | Homebrew | brew | 1395259ad67c29c353ad0528bdc297d1bb2d39ab.json | bump-*-pr: check existing PRs for exact file match | Library/Homebrew/utils/github.rb | @@ -628,8 +628,12 @@ def fetch_pull_requests(query, tap_full_name, state: nil)
[]
end
- def check_for_duplicate_pull_requests(query, tap_full_name, state:, args:)
+ def check_for_duplicate_pull_requests(query, tap_full_name, state:, file:, args:)
pull_requests = fetch_pull_requests(query, tap_full_name, state: state)
+ pull_requests.select! do |pr|
+ pr_files = open_api(url_to("repos", tap_full_name, "pulls", pr["number"], "files"))
+ pr_files.any? { |f| f["filename"] == file }
+ end
return if pull_requests.blank?
duplicates_message = <<~EOS | true |
Other | Homebrew | brew | 014985fc5cc311587501a327183e5dd79ae38818.json | Update RBI files for sorbet. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -532,14 +532,6 @@ class ActiveSupport::CurrentAttributes
def _reset_callbacks(); end
def _run_reset_callbacks(&block); end
-
- def attributes(); end
-
- def attributes=(attributes); end
-
- def reset(); end
-
- def set(set_attributes); end
end
class ActiveSupport::CurrentAttributes
@@ -561,17 +553,9 @@ class ActiveSupport::CurrentAttributes
def self.before_reset(&block); end
- def self.clear_all(); end
-
def self.instance(); end
- def self.reset(*args, &block); end
-
- def self.reset_all(); end
-
def self.resets(&block); end
-
- def self.set(*args, &block); end
end
module ActiveSupport::Dependencies
@@ -6674,6 +6658,8 @@ end
class Errno::EBADRPC
end
+Errno::ECAPMODE = Errno::NOERROR
+
Errno::EDEADLOCK = Errno::NOERROR
class Errno::EDEVERR
@@ -6694,6 +6680,13 @@ end
Errno::EIPSEC = Errno::NOERROR
+class Errno::ELAST
+ Errno = ::T.let(nil, ::T.untyped)
+end
+
+class Errno::ELAST
+end
+
class Errno::ENEEDAUTH
Errno = ::T.let(nil, ::T.untyped)
end
@@ -6715,6 +6708,8 @@ end
class Errno::ENOPOLICY
end
+Errno::ENOTCAPABLE = Errno::NOERROR
+
class Errno::ENOTSUP
Errno = ::T.let(nil, ::T.untyped)
end
@@ -6757,12 +6752,7 @@ end
class Errno::EPWROFF
end
-class Errno::EQFULL
- Errno = ::T.let(nil, ::T.untyped)
-end
-
-class Errno::EQFULL
-end
+Errno::EQFULL = Errno::ELAST
class Errno::ERPCMISMATCH
Errno = ::T.let(nil, ::T.untyped)
@@ -13127,7 +13117,6 @@ class Object
def to_query(key); end
def to_yaml(options=T.unsafe(nil)); end
- APPLE_GEM_HOME = ::T.let(nil, ::T.untyped)
ARGF = ::T.let(nil, ::T.untyped)
ARGV = ::T.let(nil, ::T.untyped)
BUG_REPORTS_URL = ::T.let(nil, ::T.untyped)
@@ -13192,8 +13181,6 @@ class Object
RUBY_DESCRIPTION = ::T.let(nil, ::T.untyped)
RUBY_ENGINE = ::T.let(nil, ::T.untyped)
RUBY_ENGINE_VERSION = ::T.let(nil, ::T.untyped)
- RUBY_FRAMEWORK = ::T.let(nil, ::T.untyped)
- RUBY_FRAMEWORK_VERSION = ::T.let(nil, ::T.untyped)
RUBY_PATCHLEVEL = ::T.let(nil, ::T.untyped)
RUBY_PATH = ::T.let(nil, ::T.untyped)
RUBY_PLATFORM = ::T.let(nil, ::T.untyped)
@@ -13246,7 +13233,11 @@ class OpenSSL::KDF::KDFError
end
module OpenSSL::KDF
+ def self.hkdf(*_); end
+
def self.pbkdf2_hmac(*_); end
+
+ def self.scrypt(*_); end
end
class OpenSSL::OCSP::Request
@@ -13255,20 +13246,29 @@ end
OpenSSL::PKCS7::Signer = OpenSSL::PKCS7::SignerInfo
+class OpenSSL::PKey::EC
+ EXPLICIT_CURVE = ::T.let(nil, ::T.untyped)
+end
+
class OpenSSL::PKey::EC::Point
def to_octet_string(_); end
end
module OpenSSL::SSL
+ OP_ALLOW_NO_DHE_KEX = ::T.let(nil, ::T.untyped)
OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = ::T.let(nil, ::T.untyped)
OP_CRYPTOPRO_TLSEXT_BUG = ::T.let(nil, ::T.untyped)
OP_LEGACY_SERVER_CONNECT = ::T.let(nil, ::T.untyped)
+ OP_NO_ENCRYPT_THEN_MAC = ::T.let(nil, ::T.untyped)
+ OP_NO_RENEGOTIATION = ::T.let(nil, ::T.untyped)
+ OP_NO_TLSv1_3 = ::T.let(nil, ::T.untyped)
OP_SAFARI_ECDHE_ECDSA_BUG = ::T.let(nil, ::T.untyped)
OP_TLSEXT_PADDING = ::T.let(nil, ::T.untyped)
SSL2_VERSION = ::T.let(nil, ::T.untyped)
SSL3_VERSION = ::T.let(nil, ::T.untyped)
TLS1_1_VERSION = ::T.let(nil, ::T.untyped)
TLS1_2_VERSION = ::T.let(nil, ::T.untyped)
+ TLS1_3_VERSION = ::T.let(nil, ::T.untyped)
TLS1_VERSION = ::T.let(nil, ::T.untyped)
end
@@ -29826,7 +29826,6 @@ class Socket
IPV6_PATHMTU = ::T.let(nil, ::T.untyped)
IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped)
IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped)
- IP_DONTFRAG = ::T.let(nil, ::T.untyped)
IP_PORTRANGE = ::T.let(nil, ::T.untyped)
IP_RECVDSTADDR = ::T.let(nil, ::T.untyped)
IP_RECVIF = ::T.let(nil, ::T.untyped)
@@ -29918,7 +29917,6 @@ module Socket::Constants
IPV6_PATHMTU = ::T.let(nil, ::T.untyped)
IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped)
IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped)
- IP_DONTFRAG = ::T.let(nil, ::T.untyped)
IP_PORTRANGE = ::T.let(nil, ::T.untyped)
IP_RECVDSTADDR = ::T.let(nil, ::T.untyped)
IP_RECVIF = ::T.let(nil, ::T.untyped) | false |
Other | Homebrew | brew | 62d44b5c8acd5686bb7f4aa6599e25e5a1c784fc.json | .vscode: add more settings, extensions. | .vscode/extensions.json | @@ -0,0 +1,8 @@
+{
+ "recommendations": [
+ "kaiwood.endwise",
+ "misogi.ruby-rubocop",
+ "rebornix.ruby",
+ "wingrunr21.vscode-ruby"
+ ]
+} | true |
Other | Homebrew | brew | 62d44b5c8acd5686bb7f4aa6599e25e5a1c784fc.json | .vscode: add more settings, extensions. | .vscode/settings.json | @@ -1,3 +1,6 @@
{
- "ruby.rubocop.executePath": "/usr/local/Homebrew/Library/Homebrew/shims/gems/"
-}
\ No newline at end of file
+ "ruby.rubocop.executePath": "Library/Homebrew/shims/gems/",
+ "files.trimTrailingWhitespace": true,
+ "editor.tabSize": 2,
+ "files.insertFinalNewline": true,
+} | true |
Other | Homebrew | brew | dc072afdb175f2e8629e015952bcdcfde7038539.json | rubocop: add shim and command.
Add a shim and a command that can be used to easily add a single
directory to your `PATH` (`Library/Homebrew/shims/gems`) and have it
automatically install, configure and run `rubocop` so you can use it
for in-editor integrations. | Library/Homebrew/dev-cmd/rubocop.sh | @@ -0,0 +1,25 @@
+#: * `rubocop`
+#:
+#: Installs, configures and runs Homebrew's `rubocop`.
+
+homebrew-rubocop() {
+ # Don't need shellcheck to follow this `source`.
+ # shellcheck disable=SC1090
+ source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh"
+ setup-ruby-path
+
+ GEM_VERSION="$("$HOMEBREW_RUBY_PATH" "$RUBY_DISABLE_OPTIONS" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
+ GEM_HOME="$HOMEBREW_LIBRARY/Homebrew/vendor/bundle/ruby/$GEM_VERSION"
+
+ if ! [[ -f "$GEM_HOME/bin/rubocop" ]]; then
+ "$HOMEBREW_BREW_FILE" install-bundler-gems
+ fi
+
+ export GEM_HOME
+ export PATH="$GEM_HOME/bin:$PATH"
+
+ # Unconditional -W0 to avoid printing e.g.:
+ # warning: parser/current is loading parser/ruby26, which recognizes
+ # warning: 2.6.6-compliant syntax, but you are running 2.6.3.
+ exec "$HOMEBREW_RUBY_PATH" "$RUBY_DISABLE_OPTIONS" -W0 -S rubocop "$@"
+} | true |
Other | Homebrew | brew | dc072afdb175f2e8629e015952bcdcfde7038539.json | rubocop: add shim and command.
Add a shim and a command that can be used to easily add a single
directory to your `PATH` (`Library/Homebrew/shims/gems`) and have it
automatically install, configure and run `rubocop` so you can use it
for in-editor integrations. | Library/Homebrew/shims/gems/rubocop | @@ -0,0 +1,2 @@
+#!/bin/bash
+exec brew rubocop "$@" | true |
Other | Homebrew | brew | dc072afdb175f2e8629e015952bcdcfde7038539.json | rubocop: add shim and command.
Add a shim and a command that can be used to easily add a single
directory to your `PATH` (`Library/Homebrew/shims/gems`) and have it
automatically install, configure and run `rubocop` so you can use it
for in-editor integrations. | completions/internal_commands_list.txt | @@ -74,6 +74,7 @@ reinstall
release-notes
remove
rm
+rubocop
ruby
search
sh | true |
Other | Homebrew | brew | dc072afdb175f2e8629e015952bcdcfde7038539.json | rubocop: add shim and command.
Add a shim and a command that can be used to easily add a single
directory to your `PATH` (`Library/Homebrew/shims/gems`) and have it
automatically install, configure and run `rubocop` so you can use it
for in-editor integrations. | docs/Manpage.md | @@ -1206,6 +1206,10 @@ a warning will be shown if the latest minor release was less than one month ago.
* `--markdown`:
Print as a Markdown list.
+### `rubocop`
+
+Installs, configures and runs Homebrew's `rubocop`.
+
### `ruby` (`-e` *`text`*|*`file`*)
Run a Ruby instance with Homebrew's libraries loaded, e.g. | true |
Other | Homebrew | brew | dc072afdb175f2e8629e015952bcdcfde7038539.json | rubocop: add shim and command.
Add a shim and a command that can be used to easily add a single
directory to your `PATH` (`Library/Homebrew/shims/gems`) and have it
automatically install, configure and run `rubocop` so you can use it
for in-editor integrations. | manpages/brew.1 | @@ -1683,6 +1683,9 @@ If \fB\-\-markdown\fR and a \fIprevious_tag\fR are passed, an extra line contain
\fB\-\-markdown\fR
Print as a Markdown list\.
.
+.SS "\fBrubocop\fR"
+Installs, configures and runs Homebrew\'s \fBrubocop\fR\.
+.
.SS "\fBruby\fR (\fB\-e\fR \fItext\fR|\fIfile\fR)"
Run a Ruby instance with Homebrew\'s libraries loaded, e\.g\. \fBbrew ruby \-e "puts :gcc\.f\.deps"\fR or \fBbrew ruby script\.rb\fR\.
. | true |
Other | Homebrew | brew | 8af489547945bd9fb3b42c9e99123ca5d1b0ec2e.json | Improve submitted analytics data
- Use default `custom-prefix` label on macOS ARM (as `/usr/local` is
not the default).
- Add architecture (or Rosetta) to analytics event label.
- Don't send minor versions on Big Sur.
- Remove defunct `HOMEBREW_OSX_VERSION` reference. | Library/Homebrew/brew.sh | @@ -313,14 +313,21 @@ then
HOMEBREW_SYSTEM="Macintosh"
[[ "$HOMEBREW_PROCESSOR" = "x86_64" ]] && HOMEBREW_PROCESSOR="Intel"
HOMEBREW_MACOS_VERSION="$(/usr/bin/sw_vers -productVersion)"
- HOMEBREW_OS_VERSION="macOS $HOMEBREW_MACOS_VERSION"
# Don't change this from Mac OS X to match what macOS itself does in Safari on 10.12
HOMEBREW_OS_USER_AGENT_VERSION="Mac OS X $HOMEBREW_MACOS_VERSION"
# Intentionally set this variable by exploding another.
# shellcheck disable=SC2086,SC2183
printf -v HOMEBREW_MACOS_VERSION_NUMERIC "%02d%02d%02d" ${HOMEBREW_MACOS_VERSION//./ }
+ # Don't include minor versions for Big Sur and later.
+ if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -gt "110000" ]]
+ then
+ HOMEBREW_OS_VERSION="macOS ${HOMEBREW_MACOS_VERSION%.*}"
+ else
+ HOMEBREW_OS_VERSION="macOS $HOMEBREW_MACOS_VERSION"
+ fi
+
# Refuse to run on pre-Yosemite
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101000" ]]
then | true |
Other | Homebrew | brew | 8af489547945bd9fb3b42c9e99123ca5d1b0ec2e.json | Improve submitted analytics data
- Use default `custom-prefix` label on macOS ARM (as `/usr/local` is
not the default).
- Add architecture (or Rosetta) to analytics event label.
- Don't send minor versions on Big Sur.
- Remove defunct `HOMEBREW_OSX_VERSION` reference. | Library/Homebrew/extend/os/mac/utils/analytics.rb | @@ -5,10 +5,24 @@ module Utils
module Analytics
class << self
extend T::Sig
+
sig { returns(String) }
def custom_prefix_label
+ return generic_custom_prefix_label if Hardware::CPU.arm?
+
"non-/usr/local"
end
+
+ sig { returns(String) }
+ def arch_label
+ if Hardware::CPU.arm?
+ "ARM"
+ elsif Hardware::CPU.in_rosetta2?
+ "Rosetta"
+ else
+ ""
+ end
+ end
end
end
end | true |
Other | Homebrew | brew | 8af489547945bd9fb3b42c9e99123ca5d1b0ec2e.json | Improve submitted analytics data
- Use default `custom-prefix` label on macOS ARM (as `/usr/local` is
not the default).
- Add architecture (or Rosetta) to analytics event label.
- Don't send minor versions on Big Sur.
- Remove defunct `HOMEBREW_OSX_VERSION` reference. | Library/Homebrew/os/mac.rb | @@ -31,7 +31,7 @@ def version
# This can be compared to numerics, strings, or symbols
# using the standard Ruby Comparable methods.
def full_version
- @full_version ||= Version.new((ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_OSX_VERSION"]).chomp)
+ @full_version ||= Version.new((ENV["HOMEBREW_MACOS_VERSION"]).chomp)
end
def full_version=(version) | true |
Other | Homebrew | brew | 8af489547945bd9fb3b42c9e99123ca5d1b0ec2e.json | Improve submitted analytics data
- Use default `custom-prefix` label on macOS ARM (as `/usr/local` is
not the default).
- Add architecture (or Rosetta) to analytics event label.
- Don't send minor versions on Big Sur.
- Remove defunct `HOMEBREW_OSX_VERSION` reference. | Library/Homebrew/test/utils/analytics_spec.rb | @@ -5,24 +5,24 @@
require "formula_installer"
describe Utils::Analytics do
- describe "::os_prefix_ci" do
- context "when os_prefix_ci is not set" do
+ describe "::os_arch_prefix_ci" do
+ context "when os_arch_prefix_ci is not set" do
before do
- described_class.clear_os_prefix_ci
+ described_class.clear_os_arch_prefix_ci
end
it "returns OS_VERSION and prefix when HOMEBREW_PREFIX is a custom prefix" do
allow(Homebrew).to receive(:default_prefix?).and_return(false)
- expect(described_class.os_prefix_ci).to include("#{OS_VERSION}, #{described_class.custom_prefix_label}")
+ expect(described_class.os_arch_prefix_ci).to include("#{OS_VERSION}, #{described_class.custom_prefix_label}")
end
it "does not include prefix when HOMEBREW_PREFIX is the default prefix" do
- expect(described_class.os_prefix_ci).not_to include(described_class.custom_prefix_label)
+ expect(described_class.os_arch_prefix_ci).not_to include(described_class.custom_prefix_label)
end
it "includes CI when ENV['CI'] is set" do
ENV["CI"] = "true"
- expect(described_class.os_prefix_ci).to include("CI")
+ expect(described_class.os_arch_prefix_ci).to include("CI")
end
end
end | true |
Other | Homebrew | brew | 8af489547945bd9fb3b42c9e99123ca5d1b0ec2e.json | Improve submitted analytics data
- Use default `custom-prefix` label on macOS ARM (as `/usr/local` is
not the default).
- Add architecture (or Rosetta) to analytics event label.
- Don't send minor versions on Big Sur.
- Remove defunct `HOMEBREW_OSX_VERSION` reference. | Library/Homebrew/utils/analytics.rb | @@ -62,7 +62,7 @@ def report(type, metadata = {})
end
end
- def report_event(category, action, label = os_prefix_ci, value = nil)
+ def report_event(category, action, label = os_arch_prefix_ci, value = nil)
report(:event,
ec: category,
ea: action,
@@ -198,19 +198,30 @@ def cask_output(cask, args:)
def custom_prefix_label
"custom-prefix"
end
+ alias generic_custom_prefix_label custom_prefix_label
- def clear_os_prefix_ci
- return unless instance_variable_defined?(:@os_prefix_ci)
+ sig { returns(String) }
+ def arch_label
+ if Hardware::CPU.arm?
+ "ARM"
+ else
+ ""
+ end
+ end
+
+ def clear_os_arch_prefix_ci
+ return unless instance_variable_defined?(:@os_arch_prefix_ci)
- remove_instance_variable(:@os_prefix_ci)
+ remove_instance_variable(:@os_arch_prefix_ci)
end
- def os_prefix_ci
- @os_prefix_ci ||= begin
+ def os_arch_prefix_ci
+ @os_arch_prefix_ci ||= begin
os = OS_VERSION
+ arch = ", #{arch_label}" if arch_label.present?
prefix = ", #{custom_prefix_label}" unless Homebrew.default_prefix?
ci = ", CI" if ENV["CI"]
- "#{os}#{prefix}#{ci}"
+ "#{os}#{arch}#{prefix}#{ci}"
end
end
| true |
Other | Homebrew | brew | e5712fc6d31c0e11117c2c0af406d95604b7ca8a.json | sorbet: Update RBI files.
Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -30877,6 +30877,10 @@ class User
extend ::T::Private::Methods::SingletonMethodHooks
end
+module Utils::AST
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
module Utils::Analytics
extend ::T::Private::Methods::SingletonMethodHooks
end | false |
Other | Homebrew | brew | 465cd9c9cabd097e63a328195cde88e4542074ca.json | Update RBI files for nokogiri. | Library/Homebrew/sorbet/rbi/gems/mini_portile2@2.4.0.rbi | @@ -1,7 +0,0 @@
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `mini_portile2` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
-
-# typed: true
-
- | true |
Other | Homebrew | brew | 465cd9c9cabd097e63a328195cde88e4542074ca.json | Update RBI files for nokogiri. | Library/Homebrew/sorbet/rbi/gems/mini_portile2@2.5.0.rbi | @@ -0,0 +1,8 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `mini_portile2` gem.
+# Please instead update this file by running `tapioca sync`.
+
+# typed: true
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires | true |
Other | Homebrew | brew | 465cd9c9cabd097e63a328195cde88e4542074ca.json | Update RBI files for nokogiri. | Library/Homebrew/sorbet/rbi/gems/nokogiri@1.11.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `nokogiri` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
+# Please instead update this file by running `tapioca sync`.
# typed: true
@@ -14,7 +14,7 @@ module Nokogiri
def jruby?; end
def make(input = T.unsafe(nil), opts = T.unsafe(nil), &blk); end
def parse(string, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end
- def uses_libxml?; end
+ def uses_libxml?(requirement = T.unsafe(nil)); end
end
end
@@ -34,9 +34,9 @@ class Nokogiri::CSS::Node
def to_type; end
def to_xpath(prefix = T.unsafe(nil), visitor = T.unsafe(nil)); end
def type; end
- def type=(_); end
+ def type=(_arg0); end
def value; end
- def value=(_); end
+ def value=(_arg0); end
end
Nokogiri::CSS::Node::ALLOW_COMBINATOR_ON_SELF = T.let(T.unsafe(nil), Array)
@@ -111,16 +111,15 @@ class Nokogiri::CSS::Parser < ::Racc::Parser
class << self
def [](string); end
def []=(string, value); end
- def cache_on; end
- def cache_on=(_); end
def cache_on?; end
- def clear_cache; end
- def parse(selector); end
- def set_cache(_); end
+ def clear_cache(create_new_object = T.unsafe(nil)); end
+ def set_cache(value); end
def without_cache(&block); end
end
end
+Nokogiri::CSS::Parser::CACHE_SWITCH_NAME = T.let(T.unsafe(nil), Symbol)
+
Nokogiri::CSS::Parser::Racc_arg = T.let(T.unsafe(nil), Array)
Nokogiri::CSS::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array)
@@ -140,7 +139,7 @@ class Nokogiri::CSS::Tokenizer
def scan_setup(str); end
def scan_str(str); end
def state; end
- def state=(_); end
+ def state=(_arg0); end
end
class Nokogiri::CSS::Tokenizer::ScanError < ::StandardError
@@ -164,11 +163,28 @@ class Nokogiri::CSS::XPathVisitor
private
+ def css_class(hay, needle); end
+ def css_class_builtin(hay, needle); end
+ def css_class_standard(hay, needle); end
def is_of_type_pseudo_class?(node); end
def nth(node, options = T.unsafe(nil)); end
def read_a_and_positive_b(values); end
end
+class Nokogiri::CSS::XPathVisitorAlwaysUseBuiltins < ::Nokogiri::CSS::XPathVisitor
+
+ private
+
+ def css_class(hay, needle); end
+end
+
+class Nokogiri::CSS::XPathVisitorOptimallyUseBuiltins < ::Nokogiri::CSS::XPathVisitor
+
+ private
+
+ def css_class(hay, needle); end
+end
+
module Nokogiri::Decorators
end
@@ -186,10 +202,10 @@ class Nokogiri::EncodingHandler
def name; end
class << self
- def [](_); end
- def alias(_, _); end
+ def [](_arg0); end
+ def alias(_arg0, _arg1); end
def clear_aliases!; end
- def delete(_); end
+ def delete(_arg0); end
end
end
@@ -223,10 +239,10 @@ class Nokogiri::HTML::Document < ::Nokogiri::XML::Document
def set_metadata_element(element); end
class << self
- def new(*_); end
+ def new(*_arg0); end
def parse(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end
- def read_io(_, _, _, _); end
- def read_memory(_, _, _, _); end
+ def read_io(_arg0, _arg1, _arg2, _arg3); end
+ def read_memory(_arg0, _arg1, _arg2, _arg3); end
end
end
@@ -244,8 +260,6 @@ class Nokogiri::HTML::Document::EncodingReader
class << self
def detect_encoding(chunk); end
- def detect_encoding_for_jruby_without_fix(chunk); end
- def is_jruby_without_fix?; end
end
end
@@ -293,7 +307,7 @@ class Nokogiri::HTML::ElementDescription
def default_desc; end
class << self
- def [](_); end
+ def [](_arg0); end
end
end
@@ -520,7 +534,7 @@ end
class Nokogiri::HTML::EntityLookup
def [](name); end
- def get(_); end
+ def get(_arg0); end
end
Nokogiri::HTML::NamedCharacters = T.let(T.unsafe(nil), Nokogiri::HTML::EntityLookup)
@@ -535,11 +549,11 @@ class Nokogiri::HTML::SAX::Parser < ::Nokogiri::XML::SAX::Parser
end
class Nokogiri::HTML::SAX::ParserContext < ::Nokogiri::XML::SAX::ParserContext
- def parse_with(_); end
+ def parse_with(_arg0); end
class << self
- def file(_, _); end
- def memory(_, _); end
+ def file(_arg0, _arg1); end
+ def memory(_arg0, _arg1); end
def new(thing, encoding = T.unsafe(nil)); end
end
end
@@ -549,31 +563,35 @@ class Nokogiri::HTML::SAX::PushParser < ::Nokogiri::XML::SAX::PushParser
def <<(chunk, last_chunk = T.unsafe(nil)); end
def document; end
- def document=(_); end
+ def document=(_arg0); end
def finish; end
def write(chunk, last_chunk = T.unsafe(nil)); end
private
- def initialize_native(_, _, _); end
- def native_write(_, _); end
+ def initialize_native(_arg0, _arg1, _arg2); end
+ def native_write(_arg0, _arg1); end
end
+Nokogiri::LIBXML2_PATCHES = T.let(T.unsafe(nil), Array)
+
+Nokogiri::LIBXML_COMPILED_VERSION = T.let(T.unsafe(nil), String)
+
Nokogiri::LIBXML_ICONV_ENABLED = T.let(T.unsafe(nil), TrueClass)
-Nokogiri::LIBXML_PARSER_VERSION = T.let(T.unsafe(nil), String)
+Nokogiri::LIBXML_LOADED_VERSION = T.let(T.unsafe(nil), String)
-Nokogiri::LIBXML_VERSION = T.let(T.unsafe(nil), String)
+Nokogiri::LIBXSLT_COMPILED_VERSION = T.let(T.unsafe(nil), String)
-Nokogiri::NOKOGIRI_LIBXML2_PATCHES = T.let(T.unsafe(nil), Array)
+Nokogiri::LIBXSLT_LOADED_VERSION = T.let(T.unsafe(nil), String)
-Nokogiri::NOKOGIRI_LIBXML2_PATH = T.let(T.unsafe(nil), String)
+Nokogiri::LIBXSLT_PATCHES = T.let(T.unsafe(nil), Array)
-Nokogiri::NOKOGIRI_LIBXSLT_PATCHES = T.let(T.unsafe(nil), Array)
+Nokogiri::OTHER_LIBRARY_VERSIONS = T.let(T.unsafe(nil), String)
-Nokogiri::NOKOGIRI_LIBXSLT_PATH = T.let(T.unsafe(nil), String)
+Nokogiri::PACKAGED_LIBRARIES = T.let(T.unsafe(nil), TrueClass)
-Nokogiri::NOKOGIRI_USE_PACKAGED_LIBRARIES = T.let(T.unsafe(nil), TrueClass)
+Nokogiri::PRECOMPILED_LIBRARIES = T.let(T.unsafe(nil), TrueClass)
class Nokogiri::SyntaxError < ::StandardError
end
@@ -583,13 +601,20 @@ Nokogiri::VERSION = T.let(T.unsafe(nil), String)
Nokogiri::VERSION_INFO = T.let(T.unsafe(nil), Hash)
class Nokogiri::VersionInfo
- def compiled_parser_version; end
+ include(::Singleton)
+ extend(::Singleton::SingletonClassMethods)
+
+ def compiled_libxml_version; end
+ def compiled_libxslt_version; end
def engine; end
def jruby?; end
def libxml2?; end
+ def libxml2_has_iconv?; end
+ def libxml2_precompiled?; end
def libxml2_using_packaged?; end
def libxml2_using_system?; end
- def loaded_parser_version; end
+ def loaded_libxml_version; end
+ def loaded_libxslt_version; end
def to_hash; end
def to_markdown; end
def warnings; end
@@ -602,25 +627,25 @@ end
module Nokogiri::XML
class << self
def Reader(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end
- def RelaxNG(string_or_io); end
- def Schema(string_or_io); end
+ def RelaxNG(string_or_io, options = T.unsafe(nil)); end
+ def Schema(string_or_io, options = T.unsafe(nil)); end
def fragment(string); end
def parse(thing, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil), &block); end
end
end
class Nokogiri::XML::Attr < ::Nokogiri::XML::Node
- def content=(_); end
+ def content=(_arg0); end
def to_s; end
def value; end
- def value=(_); end
+ def value=(_arg0); end
private
def inspect_attributes; end
class << self
- def new(*_); end
+ def new(*_arg0); end
end
end
@@ -637,16 +662,16 @@ class Nokogiri::XML::Builder
def <<(string); end
def [](ns); end
def arity; end
- def arity=(_); end
+ def arity=(_arg0); end
def cdata(string); end
def comment(string); end
def context; end
- def context=(_); end
+ def context=(_arg0); end
def doc; end
- def doc=(_); end
+ def doc=(_arg0); end
def method_missing(method, *args, &block); end
def parent; end
- def parent=(_); end
+ def parent=(_arg0); end
def text(string); end
def to_xml(*args); end
@@ -671,7 +696,7 @@ class Nokogiri::XML::CDATA < ::Nokogiri::XML::Text
def name; end
class << self
- def new(*_); end
+ def new(*_arg0); end
end
end
@@ -681,7 +706,7 @@ end
class Nokogiri::XML::Comment < ::Nokogiri::XML::CharacterData
class << self
- def new(*_); end
+ def new(*_arg0); end
end
end
@@ -696,38 +721,37 @@ class Nokogiri::XML::DTD < ::Nokogiri::XML::Node
def keys; end
def notations; end
def system_id; end
- def validate(_); end
+ def validate(_arg0); end
end
class Nokogiri::XML::Document < ::Nokogiri::XML::Node
def initialize(*args); end
def <<(node_or_tags); end
def add_child(node_or_tags); end
- def canonicalize(*_); end
- def clone(*_); end
+ def canonicalize(*_arg0); end
+ def clone(*_arg0); end
def collect_namespaces; end
def create_cdata(string, &block); end
def create_comment(string, &block); end
def create_element(name, *args, &block); end
- def create_entity(*_); end
+ def create_entity(*_arg0); end
def create_text_node(string, &block); end
def decorate(node); end
def decorators(key); end
def document; end
- def dup(*_); end
+ def dup(*_arg0); end
def encoding; end
- def encoding=(_); end
+ def encoding=(_arg0); end
def errors; end
- def errors=(_); end
+ def errors=(_arg0); end
def fragment(tags = T.unsafe(nil)); end
def name; end
def namespaces; end
def remove_namespaces!; end
def root; end
- def root=(_); end
+ def root=(_arg0); end
def slop!; end
- def to_java; end
def to_xml(*args, &block); end
def url; end
def validate; end
@@ -739,11 +763,10 @@ class Nokogiri::XML::Document < ::Nokogiri::XML::Node
class << self
def empty_doc?(string_or_io); end
- def new(*_); end
+ def new(*_arg0); end
def parse(string_or_io, url = T.unsafe(nil), encoding = T.unsafe(nil), options = T.unsafe(nil)); end
- def read_io(_, _, _, _); end
- def read_memory(_, _, _, _); end
- def wrap(document); end
+ def read_io(_arg0, _arg1, _arg2, _arg3); end
+ def read_memory(_arg0, _arg1, _arg2, _arg3); end
end
end
@@ -762,6 +785,7 @@ class Nokogiri::XML::DocumentFragment < ::Nokogiri::XML::Node
def dup; end
def errors; end
def errors=(things); end
+ def fragment(data); end
def name; end
def search(*rules); end
def serialize; end
@@ -772,11 +796,10 @@ class Nokogiri::XML::DocumentFragment < ::Nokogiri::XML::Node
private
- def coerce(data); end
def namespace_declarations(ctx); end
class << self
- def new(*_); end
+ def new(*_arg0); end
def parse(tags); end
end
end
@@ -851,7 +874,7 @@ class Nokogiri::XML::EntityReference < ::Nokogiri::XML::Node
def inspect_attributes; end
class << self
- def new(*_); end
+ def new(*_arg0); end
end
end
@@ -882,18 +905,18 @@ class Nokogiri::XML::Node
def []=(name, value); end
def accept(visitor); end
def add_child(node_or_tags); end
- def add_class(name); end
- def add_namespace(_, _); end
- def add_namespace_definition(_, _); end
+ def add_class(names); end
+ def add_namespace(_arg0, _arg1); end
+ def add_namespace_definition(_arg0, _arg1); end
def add_next_sibling(node_or_tags); end
def add_previous_sibling(node_or_tags); end
def after(node_or_tags); end
def ancestors(selector = T.unsafe(nil)); end
- def append_class(name); end
+ def append_class(names); end
def attr(name); end
- def attribute(_); end
+ def attribute(_arg0); end
def attribute_nodes; end
- def attribute_with_ns(_, _); end
+ def attribute_with_ns(_arg0, _arg1); end
def attributes; end
def before(node_or_tags); end
def blank?; end
@@ -903,12 +926,12 @@ class Nokogiri::XML::Node
def children; end
def children=(node_or_tags); end
def classes; end
- def clone(*_); end
+ def clone(*_arg0); end
def comment?; end
def content; end
def content=(string); end
- def create_external_subset(_, _, _); end
- def create_internal_subset(_, _, _); end
+ def create_external_subset(_arg0, _arg1, _arg2); end
+ def create_internal_subset(_arg0, _arg1, _arg2); end
def css_path; end
def decorate!; end
def default_namespace=(url); end
@@ -917,46 +940,51 @@ class Nokogiri::XML::Node
def do_xinclude(options = T.unsafe(nil)); end
def document; end
def document?; end
- def dup(*_); end
+ def dup(*_arg0); end
def each; end
def elem?; end
def element?; end
def element_children; end
def elements; end
- def encode_special_chars(_); end
+ def encode_special_chars(_arg0); end
def external_subset; end
def first_element_child; end
def fragment(tags); end
def fragment?; end
def get_attribute(name); end
- def has_attribute?(_); end
+ def has_attribute?(_arg0); end
def html?; end
def inner_html(*args); end
def inner_html=(node_or_tags); end
def inner_text; end
def internal_subset; end
- def key?(_); end
+ def key?(_arg0); end
def keys; end
+ def kwattr_add(attribute_name, keywords); end
+ def kwattr_append(attribute_name, keywords); end
+ def kwattr_remove(attribute_name, keywords); end
+ def kwattr_values(attribute_name); end
def lang; end
- def lang=(_); end
+ def lang=(_arg0); end
def last_element_child; end
def line; end
+ def line=(_arg0); end
def matches?(selector); end
def name; end
- def name=(_); end
+ def name=(_arg0); end
def namespace; end
def namespace=(ns); end
def namespace_definitions; end
def namespace_scopes; end
- def namespaced_key?(_, _); end
+ def namespaced_key?(_arg0, _arg1); end
def namespaces; end
- def native_content=(_); end
+ def native_content=(_arg0); end
def next; end
def next=(node_or_tags); end
def next_element; end
def next_sibling; end
def node_name; end
- def node_name=(_); end
+ def node_name=(_arg0); end
def node_type; end
def parent; end
def parent=(parent_node); end
@@ -972,7 +1000,7 @@ class Nokogiri::XML::Node
def read_only?; end
def remove; end
def remove_attribute(name); end
- def remove_class(name = T.unsafe(nil)); end
+ def remove_class(names = T.unsafe(nil)); end
def replace(node_or_tags); end
def serialize(*args, &block); end
def set_attribute(name, value); end
@@ -987,6 +1015,7 @@ class Nokogiri::XML::Node
def traverse(&block); end
def type; end
def unlink; end
+ def value?(value); end
def values; end
def wrap(html); end
def write_html_to(io, options = T.unsafe(nil)); end
@@ -995,29 +1024,33 @@ class Nokogiri::XML::Node
def write_xml_to(io, options = T.unsafe(nil)); end
def xml?; end
+ protected
+
+ def coerce(data); end
+
private
- def add_child_node(_); end
+ def add_child_node(_arg0); end
def add_child_node_and_reparent_attrs(node); end
- def add_next_sibling_node(_); end
- def add_previous_sibling_node(_); end
+ def add_next_sibling_node(_arg0); end
+ def add_previous_sibling_node(_arg0); end
def add_sibling(next_or_previous, node_or_tags); end
- def coerce(data); end
- def compare(_); end
+ def compare(_arg0); end
def dump_html; end
- def get(_); end
- def in_context(_, _); end
+ def get(_arg0); end
+ def in_context(_arg0, _arg1); end
def inspect_attributes; end
- def native_write_to(_, _, _, _); end
- def process_xincludes(_); end
- def replace_node(_); end
- def set(_, _); end
- def set_namespace(_); end
+ def keywordify(keywords); end
+ def native_write_to(_arg0, _arg1, _arg2, _arg3); end
+ def process_xincludes(_arg0); end
+ def replace_node(_arg0); end
+ def set(_arg0, _arg1); end
+ def set_namespace(_arg0); end
def to_format(save_option, options); end
def write_format_to(save_option, io, options); end
class << self
- def new(*_); end
+ def new(*_arg0); end
end
end
@@ -1119,13 +1152,13 @@ class Nokogiri::XML::NodeSet
def initialize(document, list = T.unsafe(nil)); end
def %(*args); end
- def &(_); end
- def +(_); end
- def -(_); end
- def <<(_); end
+ def &(_arg0); end
+ def +(_arg0); end
+ def -(_arg0); end
+ def <<(_arg0); end
def ==(other); end
def >(selector); end
- def [](*_); end
+ def [](*_arg0); end
def add_class(name); end
def after(datum); end
def append_class(name); end
@@ -1136,23 +1169,23 @@ class Nokogiri::XML::NodeSet
def children; end
def clone; end
def css(*args); end
- def delete(_); end
+ def delete(_arg0); end
def document; end
- def document=(_); end
+ def document=(_arg0); end
def dup; end
def each; end
def empty?; end
def filter(expr); end
def first(n = T.unsafe(nil)); end
- def include?(_); end
+ def include?(_arg0); end
def index(node = T.unsafe(nil)); end
def inner_html(*args); end
def inner_text; end
def inspect; end
def last; end
def length; end
def pop; end
- def push(_); end
+ def push(_arg0); end
def remove; end
def remove_attr(name); end
def remove_attribute(name); end
@@ -1161,7 +1194,7 @@ class Nokogiri::XML::NodeSet
def set(key, value = T.unsafe(nil), &block); end
def shift; end
def size; end
- def slice(*_); end
+ def slice(*_arg0); end
def text; end
def to_a; end
def to_ary; end
@@ -1172,7 +1205,7 @@ class Nokogiri::XML::NodeSet
def unlink; end
def wrap(html); end
def xpath(*args); end
- def |(_); end
+ def |(_arg0); end
end
Nokogiri::XML::NodeSet::IMPLIED_XPATH_CONTEXTS = T.let(T.unsafe(nil), Array)
@@ -1196,10 +1229,13 @@ end
class Nokogiri::XML::ParseOptions
def initialize(options = T.unsafe(nil)); end
+ def ==(other); end
def compact; end
def compact?; end
def default_html; end
def default_html?; end
+ def default_schema; end
+ def default_schema?; end
def default_xml; end
def default_xml?; end
def dtdattr; end
@@ -1219,6 +1255,7 @@ class Nokogiri::XML::ParseOptions
def nocdata?; end
def nocompact; end
def nodefault_html; end
+ def nodefault_schema; end
def nodefault_xml; end
def nodict; end
def nodict?; end
@@ -1256,7 +1293,7 @@ class Nokogiri::XML::ParseOptions
def old10; end
def old10?; end
def options; end
- def options=(_); end
+ def options=(_arg0); end
def pedantic; end
def pedantic?; end
def recover; end
@@ -1274,6 +1311,8 @@ Nokogiri::XML::ParseOptions::COMPACT = T.let(T.unsafe(nil), Integer)
Nokogiri::XML::ParseOptions::DEFAULT_HTML = T.let(T.unsafe(nil), Integer)
+Nokogiri::XML::ParseOptions::DEFAULT_SCHEMA = T.let(T.unsafe(nil), Integer)
+
Nokogiri::XML::ParseOptions::DEFAULT_XML = T.let(T.unsafe(nil), Integer)
Nokogiri::XML::ParseOptions::DTDATTR = T.let(T.unsafe(nil), Integer)
@@ -1320,7 +1359,7 @@ class Nokogiri::XML::ProcessingInstruction < ::Nokogiri::XML::Node
def initialize(document, name, content); end
class << self
- def new(*_); end
+ def new(*_arg0); end
end
end
@@ -1329,8 +1368,8 @@ class Nokogiri::XML::Reader
def initialize(source, url = T.unsafe(nil), encoding = T.unsafe(nil)); end
- def attribute(_); end
- def attribute_at(_); end
+ def attribute(_arg0); end
+ def attribute_at(_arg0); end
def attribute_count; end
def attribute_nodes; end
def attributes; end
@@ -1342,7 +1381,7 @@ class Nokogiri::XML::Reader
def empty_element?; end
def encoding; end
def errors; end
- def errors=(_); end
+ def errors=(_arg0); end
def inner_xml; end
def lang; end
def local_name; end
@@ -1365,8 +1404,8 @@ class Nokogiri::XML::Reader
def attr_nodes; end
class << self
- def from_io(*_); end
- def from_memory(*_); end
+ def from_io(*_arg0); end
+ def from_memory(*_arg0); end
end
end
@@ -1410,11 +1449,11 @@ class Nokogiri::XML::RelaxNG < ::Nokogiri::XML::Schema
private
- def validate_document(_); end
+ def validate_document(_arg0); end
class << self
- def from_document(_); end
- def read_memory(_); end
+ def from_document(*_arg0); end
+ def read_memory(*_arg0); end
end
end
@@ -1441,9 +1480,9 @@ class Nokogiri::XML::SAX::Parser
def initialize(doc = T.unsafe(nil), encoding = T.unsafe(nil)); end
def document; end
- def document=(_); end
+ def document=(_arg0); end
def encoding; end
- def encoding=(_); end
+ def encoding=(_arg0); end
def parse(thing, &block); end
def parse_file(filename); end
def parse_io(io, encoding = T.unsafe(nil)); end
@@ -1462,16 +1501,16 @@ Nokogiri::XML::SAX::Parser::ENCODINGS = T.let(T.unsafe(nil), Hash)
class Nokogiri::XML::SAX::ParserContext
def column; end
def line; end
- def parse_with(_); end
+ def parse_with(_arg0); end
def recovery; end
- def recovery=(_); end
+ def recovery=(_arg0); end
def replace_entities; end
- def replace_entities=(_); end
+ def replace_entities=(_arg0); end
class << self
- def file(_); end
- def io(_, _); end
- def memory(_); end
+ def file(_arg0); end
+ def io(_arg0, _arg1); end
+ def memory(_arg0); end
def new(thing, encoding = T.unsafe(nil)); end
end
end
@@ -1481,35 +1520,37 @@ class Nokogiri::XML::SAX::PushParser
def <<(chunk, last_chunk = T.unsafe(nil)); end
def document; end
- def document=(_); end
+ def document=(_arg0); end
def finish; end
def options; end
- def options=(_); end
+ def options=(_arg0); end
def replace_entities; end
- def replace_entities=(_); end
+ def replace_entities=(_arg0); end
def write(chunk, last_chunk = T.unsafe(nil)); end
private
- def initialize_native(_, _); end
- def native_write(_, _); end
+ def initialize_native(_arg0, _arg1); end
+ def native_write(_arg0, _arg1); end
end
class Nokogiri::XML::Schema
def errors; end
- def errors=(_); end
+ def errors=(_arg0); end
+ def parse_options; end
+ def parse_options=(_arg0); end
def valid?(thing); end
def validate(thing); end
private
- def validate_document(_); end
- def validate_file(_); end
+ def validate_document(_arg0); end
+ def validate_file(_arg0); end
class << self
- def from_document(_); end
- def new(string_or_io); end
- def read_memory(_); end
+ def from_document(*_arg0); end
+ def new(string_or_io, options = T.unsafe(nil)); end
+ def read_memory(*_arg0); end
end
end
@@ -1563,7 +1604,7 @@ class Nokogiri::XML::Text < ::Nokogiri::XML::CharacterData
def content=(string); end
class << self
- def new(*_); end
+ def new(*_arg0); end
end
end
@@ -1575,38 +1616,38 @@ Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 = T.let(T.unsafe(nil), Integer)
class Nokogiri::XML::XPath
def document; end
- def document=(_); end
+ def document=(_arg0); end
end
class Nokogiri::XML::XPath::SyntaxError < ::Nokogiri::XML::SyntaxError
def to_s; end
end
class Nokogiri::XML::XPathContext
- def evaluate(*_); end
+ def evaluate(*_arg0); end
def register_namespaces(namespaces); end
- def register_ns(_, _); end
- def register_variable(_, _); end
+ def register_ns(_arg0, _arg1); end
+ def register_variable(_arg0, _arg1); end
class << self
- def new(_); end
+ def new(_arg0); end
end
end
module Nokogiri::XSLT
class << self
def parse(string, modules = T.unsafe(nil)); end
def quote_params(params); end
- def register(_, _); end
+ def register(_arg0, _arg1); end
end
end
class Nokogiri::XSLT::Stylesheet
def apply_to(document, params = T.unsafe(nil)); end
- def serialize(_); end
- def transform(*_); end
+ def serialize(_arg0); end
+ def transform(*_arg0); end
class << self
- def parse_stylesheet_doc(_); end
+ def parse_stylesheet_doc(_arg0); end
end
end | true |
Other | Homebrew | brew | 465cd9c9cabd097e63a328195cde88e4542074ca.json | Update RBI files for nokogiri. | Library/Homebrew/sorbet/rbi/gems/racc@1.5.2.rbi | @@ -0,0 +1,57 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `racc` gem.
+# Please instead update this file by running `tapioca sync`.
+
+# typed: true
+
+ParseError = Racc::ParseError
+
+Racc::Copyright = T.let(T.unsafe(nil), String)
+
+class Racc::Parser
+ def _racc_do_parse_rb(arg, in_debug); end
+ def _racc_do_reduce(arg, act); end
+ def _racc_evalact(act, arg); end
+ def _racc_init_sysvars; end
+ def _racc_setup; end
+ def _racc_yyparse_rb(recv, mid, arg, c_debug); end
+ def next_token; end
+ def on_error(t, val, vstack); end
+ def racc_accept; end
+ def racc_e_pop(state, tstack, vstack); end
+ def racc_next_state(curstate, state); end
+ def racc_print_stacks(t, v); end
+ def racc_print_states(s); end
+ def racc_read_token(t, tok, val); end
+ def racc_reduce(toks, sim, tstack, vstack); end
+ def racc_shift(tok, tstack, vstack); end
+ def racc_token2str(tok); end
+ def token_to_str(t); end
+ def yyaccept; end
+ def yyerrok; end
+ def yyerror; end
+
+ class << self
+ def racc_runtime_type; end
+ end
+end
+
+Racc::Parser::Racc_Main_Parsing_Routine = T.let(T.unsafe(nil), Symbol)
+
+Racc::Parser::Racc_Runtime_Core_Id_C = T.let(T.unsafe(nil), String)
+
+Racc::Parser::Racc_Runtime_Core_Version = T.let(T.unsafe(nil), String)
+
+Racc::Parser::Racc_Runtime_Core_Version_C = T.let(T.unsafe(nil), String)
+
+Racc::Parser::Racc_Runtime_Core_Version_R = T.let(T.unsafe(nil), String)
+
+Racc::Parser::Racc_Runtime_Type = T.let(T.unsafe(nil), String)
+
+Racc::Parser::Racc_Runtime_Version = T.let(T.unsafe(nil), String)
+
+Racc::Parser::Racc_YY_Parse_Method = T.let(T.unsafe(nil), Symbol)
+
+Racc::VERSION = T.let(T.unsafe(nil), String)
+
+Racc::Version = T.let(T.unsafe(nil), String) | true |
Other | Homebrew | brew | 465cd9c9cabd097e63a328195cde88e4542074ca.json | Update RBI files for nokogiri. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -13950,8 +13950,6 @@ end
module Parlour
end
-ParseError = Racc::ParseError
-
class Parser::Ruby24
def _reduce_10(val, _values, result); end
@@ -25536,21 +25534,6 @@ end
class Racc::CparseParams
end
-class Racc::Parser
- Racc_Main_Parsing_Routine = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Core_Id_C = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Core_Revision = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Core_Revision_C = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Core_Revision_R = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Core_Version = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Core_Version_C = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Core_Version_R = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Revision = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Type = ::T.let(nil, ::T.untyped)
- Racc_Runtime_Version = ::T.let(nil, ::T.untyped)
- Racc_YY_Parse_Method = ::T.let(nil, ::T.untyped)
-end
-
module Rack
CACHE_CONTROL = ::T.let(nil, ::T.untyped)
CONTENT_LENGTH = ::T.let(nil, ::T.untyped)
@@ -29788,6 +29771,12 @@ module Singleton
def dup(); end
end
+module Singleton::SingletonClassMethods
+ def _load(str); end
+
+ def clone(); end
+end
+
module Singleton
def self.__init__(klass); end
end
@@ -30877,6 +30866,10 @@ class User
extend ::T::Private::Methods::SingletonMethodHooks
end
+module Utils::AST
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
module Utils::Analytics
extend ::T::Private::Methods::SingletonMethodHooks
end | true |
Other | Homebrew | brew | da86bb50c92f055218b8f2db10b0d750b7369153.json | Ignore `racc` gem. | .gitignore | @@ -117,6 +117,7 @@
**/vendor/bundle/ruby/*/gems/powerpack-*/
**/vendor/bundle/ruby/*/gems/psych-*/
**/vendor/bundle/ruby/*/gems/pry-*/
+**/vendor/bundle/ruby/*/gems/racc-*/
**/vendor/bundle/ruby/*/gems/rainbow-*/
**/vendor/bundle/ruby/*/gems/rdiscount-*/
**/vendor/bundle/ruby/*/gems/regexp_parser-*/ | false |
Other | Homebrew | brew | 924d42e4cb80d3a1a64118cf82819372cba1187c.json | cask: add DSL methods to RBI file | Library/Homebrew/cask/cask.rbi | @@ -2,10 +2,44 @@
module Cask
class Cask
+ def appcast; end
+
def artifacts; end
+ def auto_updates; end
+
+ def caveats; end
+
+ def conflicts_with; end
+
+ def container; end
+
+ def desc; end
+
+ def depends_on; end
+
def homepage; end
+ def language; end
+
+ def languages; end
+
+ def name; end
+
+ def sha256; end
+
def staged_path; end
+
+ def url; end
+
+ def version; end
+
+ def appdir; end
+
+ def discontinued?; end
+
+ def livecheck; end
+
+ def livecheckable?; end
end
end | false |
Other | Homebrew | brew | 8828b4bd68b01acc1ea641a00e0428bae428a96e.json | utils/ast: add `stanza_text` helper function | Library/Homebrew/dev-cmd/bump-revision.rb | @@ -37,24 +37,25 @@ def bump_revision
args.named.to_formulae.each do |formula|
current_revision = formula.revision
- text = "revision #{current_revision+1}"
+ new_revision = current_revision + 1
if args.dry_run?
unless args.quiet?
+ old_text = "revision #{current_revision}"
+ new_text = "revision #{new_revision}"
if current_revision.zero?
- ohai "add #{text.inspect}"
+ ohai "add #{new_text.inspect}"
else
- old = "revision #{current_revision}"
- ohai "replace #{old.inspect} with #{text.inspect}"
+ ohai "replace #{old_text.inspect} with #{new_text.inspect}"
end
end
else
Utils::Inreplace.inreplace(formula.path) do |s|
s = s.inreplace_string
if current_revision.zero?
- Utils::AST.add_formula_stanza!(s, :revision, text)
+ Utils::AST.add_formula_stanza!(s, :revision, new_revision)
else
- Utils::AST.replace_formula_stanza!(s, :revision, text)
+ Utils::AST.replace_formula_stanza!(s, :revision, new_revision)
end
end
end | true |
Other | Homebrew | brew | 8828b4bd68b01acc1ea641a00e0428bae428a96e.json | utils/ast: add `stanza_text` helper function | Library/Homebrew/test/utils/ast_spec.rb | @@ -20,7 +20,7 @@ class Foo < Formula
describe ".replace_formula_stanza!" do
it "replaces the specified stanza in a formula" do
contents = initial_formula.dup
- described_class.replace_formula_stanza!(contents, :license, "license :public_domain")
+ described_class.replace_formula_stanza!(contents, :license, :public_domain)
expect(contents).to eq <<~RUBY
class Foo < Formula
url "https://brew.sh/foo-1.0.tar.gz"
@@ -33,7 +33,7 @@ class Foo < Formula
describe ".add_formula_stanza!" do
it "adds the specified stanza to a formula" do
contents = initial_formula.dup
- described_class.add_formula_stanza!(contents, :revision, "revision 1")
+ described_class.add_formula_stanza!(contents, :revision, 1)
expect(contents).to eq <<~RUBY
class Foo < Formula
url "https://brew.sh/foo-1.0.tar.gz"
@@ -48,6 +48,50 @@ class Foo < Formula
end
end
+ describe ".stanza_text" do
+ let(:compound_license) do
+ <<~RUBY.chomp
+ license all_of: [
+ :public_domain,
+ "MIT",
+ "GPL-3.0-or-later" => { with: "Autoconf-exception-3.0" },
+ ]
+ RUBY
+ end
+
+ it "accepts existing stanza text" do
+ expect(described_class.stanza_text(:revision, "revision 1")).to eq("revision 1")
+ expect(described_class.stanza_text(:license, "license :public_domain")).to eq("license :public_domain")
+ expect(described_class.stanza_text(:license, 'license "MIT"')).to eq('license "MIT"')
+ expect(described_class.stanza_text(:license, compound_license)).to eq(compound_license)
+ end
+
+ it "accepts a number as the stanza value" do
+ expect(described_class.stanza_text(:revision, 1)).to eq("revision 1")
+ end
+
+ it "accepts a symbol as the stanza value" do
+ expect(described_class.stanza_text(:license, :public_domain)).to eq("license :public_domain")
+ end
+
+ it "accepts a string as the stanza value" do
+ expect(described_class.stanza_text(:license, "MIT")).to eq('license "MIT"')
+ end
+
+ it "adds indent to stanza text if specified" do
+ expect(described_class.stanza_text(:revision, "revision 1", indent: 2)).to eq(" revision 1")
+ expect(described_class.stanza_text(:license, 'license "MIT"', indent: 2)).to eq(' license "MIT"')
+ expect(described_class.stanza_text(:license, compound_license, indent: 2)).to eq(compound_license.indent(2))
+ end
+
+ it "does not add indent if already indented" do
+ expect(described_class.stanza_text(:revision, " revision 1", indent: 2)).to eq(" revision 1")
+ expect(
+ described_class.stanza_text(:license, compound_license.indent(2), indent: 2),
+ ).to eq(compound_license.indent(2))
+ end
+ end
+
describe ".add_bottle_stanza!" do
let(:bottle_output) do
<<~RUBY.chomp.indent(2) | true |
Other | Homebrew | brew | 8828b4bd68b01acc1ea641a00e0428bae428a96e.json | utils/ast: add `stanza_text` helper function | Library/Homebrew/utils/ast.rb | @@ -29,7 +29,7 @@ def formula_stanza(formula_contents, name, type: nil)
end
def replace_bottle_stanza!(formula_contents, bottle_output)
- replace_formula_stanza!(formula_contents, :bottle, bottle_output.strip, type: :block_call)
+ replace_formula_stanza!(formula_contents, :bottle, bottle_output.chomp, type: :block_call)
end
def add_bottle_stanza!(formula_contents, bottle_output)
@@ -42,11 +42,11 @@ def replace_formula_stanza!(formula_contents, name, replacement, type: nil)
raise "Could not find #{name} stanza!" if stanza_node.nil?
tree_rewriter = Parser::Source::TreeRewriter.new(processed_source.buffer)
- tree_rewriter.replace(stanza_node.source_range, replacement)
+ tree_rewriter.replace(stanza_node.source_range, stanza_text(name, replacement, indent: 2).lstrip)
formula_contents.replace(tree_rewriter.process)
end
- def add_formula_stanza!(formula_contents, name, text, type: nil)
+ def add_formula_stanza!(formula_contents, name, value, type: nil)
processed_source, children = process_formula(formula_contents)
preceding_component = if children.length > 1
@@ -80,19 +80,35 @@ def add_formula_stanza!(formula_contents, name, text, type: nil)
end
tree_rewriter = Parser::Source::TreeRewriter.new(processed_source.buffer)
- tree_rewriter.insert_after(preceding_expr, "\n#{text.match?(/\A\s+/) ? text : text.indent(2)}")
+ tree_rewriter.insert_after(preceding_expr, "\n#{stanza_text(name, value, indent: 2)}")
formula_contents.replace(tree_rewriter.process)
end
+ sig { params(name: Symbol, value: T.any(Numeric, String, Symbol), indent: T.nilable(Integer)).returns(String) }
+ def stanza_text(name, value, indent: nil)
+ text = if value.is_a?(String)
+ _, node = process_source(value)
+ value if (node.send_type? || node.block_type?) && node.method_name == name
+ end
+ text ||= "#{name} #{value.inspect}"
+ text = text.indent(indent) if indent && !text.match?(/\A\n* +/)
+ text
+ end
+
private
- def process_formula(formula_contents)
+ def process_source(source)
Homebrew.install_bundler_gems!
require "rubocop-ast"
ruby_version = Version.new(HOMEBREW_REQUIRED_RUBY_VERSION).major_minor.to_f
- processed_source = RuboCop::AST::ProcessedSource.new(formula_contents, ruby_version)
+ processed_source = RuboCop::AST::ProcessedSource.new(source, ruby_version)
root_node = processed_source.ast
+ [processed_source, root_node]
+ end
+
+ def process_formula(formula_contents)
+ processed_source, root_node = process_source(formula_contents)
class_node = if root_node.class_type?
root_node | true |
Other | Homebrew | brew | 8dcd2d2ba87f4677b1348ada1959d526c9769722.json | Add a missing backtick | docs/Shell-Completion.md | @@ -8,7 +8,7 @@ You must configure your shell to enable its completion support. This is because
## Configuring Completions in `bash`
-To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.bash_profile` (or, if it doesn't exist, `~/.profile):
+To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.bash_profile` (or, if it doesn't exist, `~/.profile`):
```sh
if type brew &>/dev/null; then | false |
Other | Homebrew | brew | e5d656bcce8b68bb11d4bd7a6f2160e6b7ba2bc7.json | Avoid unnecessary downloads in `audit`. | Library/Homebrew/utils/curl.rb | @@ -154,12 +154,25 @@ def url_protected_by_incapsula?(details)
def curl_check_http_content(url, user_agents: [:default], check_content: false, strict: false)
return unless url.start_with? "http"
+ secure_url = url.sub(/\Ahttp:/, "https:")
+ secure_details = nil
+ hash_needed = false
+ if url != secure_url
+ user_agents.each do |user_agent|
+ secure_details =
+ curl_http_content_headers_and_checksum(secure_url, hash_needed: true, user_agent: user_agent)
+
+ next unless http_status_ok?(secure_details[:status])
+
+ hash_needed = true
+ user_agents = [user_agent]
+ break
+ end
+ end
+
details = nil
- user_agent = nil
- hash_needed = url.start_with?("http:")
- user_agents.each do |ua|
- details = curl_http_content_headers_and_checksum(url, hash_needed: hash_needed, user_agent: ua)
- user_agent = ua
+ user_agents.each do |user_agent|
+ details = curl_http_content_headers_and_checksum(url, hash_needed: hash_needed, user_agent: user_agent)
break if http_status_ok?(details[:status])
end
@@ -181,16 +194,9 @@ def curl_check_http_content(url, user_agents: [:default], check_content: false,
return "The URL #{url} redirects back to HTTP"
end
- return unless hash_needed
-
- secure_url = url.sub "http", "https"
- secure_details =
- curl_http_content_headers_and_checksum(secure_url, hash_needed: true, user_agent: user_agent)
+ return unless secure_details
- if !http_status_ok?(details[:status]) ||
- !http_status_ok?(secure_details[:status])
- return
- end
+ return if !http_status_ok?(details[:status]) || !http_status_ok?(secure_details[:status])
etag_match = details[:etag] &&
details[:etag] == secure_details[:etag]
@@ -208,25 +214,24 @@ def curl_check_http_content(url, user_agents: [:default], check_content: false,
return unless check_content
no_protocol_file_contents = %r{https?:\\?/\\?/}
- details[:file] = details[:file].gsub(no_protocol_file_contents, "/")
- secure_details[:file] = secure_details[:file].gsub(no_protocol_file_contents, "/")
+ http_content = details[:file]&.gsub(no_protocol_file_contents, "/")
+ https_content = secure_details[:file]&.gsub(no_protocol_file_contents, "/")
# Check for the same content after removing all protocols
- if (details[:file] == secure_details[:file]) &&
- secure_details[:final_url].start_with?("https://") &&
- url.start_with?("http://")
+ if (http_content && https_content) && (http_content == https_content) &&
+ url.start_with?("http://") && secure_details[:final_url].start_with?("https://")
return "The URL #{url} should use HTTPS rather than HTTP"
end
return unless strict
# Same size, different content after normalization
# (typical causes: Generated ID, Timestamp, Unix time)
- if details[:file].length == secure_details[:file].length
+ if http_content.length == https_content.length
return "The URL #{url} may be able to use HTTPS rather than HTTP. Please verify it in a browser."
end
- lenratio = (100 * secure_details[:file].length / details[:file].length).to_i
+ lenratio = (100 * https_content.length / http_content.length).to_i
return unless (90..110).cover?(lenratio)
"The URL #{url} may be able to use HTTPS rather than HTTP. Please verify it in a browser."
@@ -236,9 +241,9 @@ def curl_http_content_headers_and_checksum(url, hash_needed: false, user_agent:
file = Tempfile.new.tap(&:close)
max_time = hash_needed ? "600" : "25"
- output, = curl_output(
+ output, _, status = curl_output(
"--dump-header", "-", "--output", file.path, "--location",
- "--connect-timeout", "15", "--max-time", max_time, url,
+ "--connect-timeout", "15", "--max-time", max_time, "--retry-max-time", max_time, url,
user_agent: user_agent
)
@@ -250,7 +255,10 @@ def curl_http_content_headers_and_checksum(url, hash_needed: false, user_agent:
final_url = location.chomp if location
end
- file_hash = Digest::SHA256.file(file.path) if hash_needed
+ if status.success?
+ file_contents = File.read(file.path)
+ file_hash = Digest::SHA2.hexdigest(file_contents) if hash_needed
+ end
final_url ||= url
@@ -262,7 +270,7 @@ def curl_http_content_headers_and_checksum(url, hash_needed: false, user_agent:
content_length: headers[/Content-Length: (\d+)/, 1],
headers: headers,
file_hash: file_hash,
- file: File.read(file.path),
+ file: file_contents,
}
ensure
file.unlink | false |
Other | Homebrew | brew | ec841e7b6217e3038b2ca74c2c60084f1a0fd11f.json | bottle: add `old_checksums` helper function | Library/Homebrew/dev-cmd/bottle.rb | @@ -489,36 +489,21 @@ def merge(args:)
bottle.sha256 tag_hash["sha256"] => tag.to_sym
end
- output = bottle_output bottle
-
if args.write?
path = Pathname.new((HOMEBREW_REPOSITORY/bottle_hash["formula"]["path"]).to_s)
- update_or_add = T.let(nil, T.nilable(String))
+ checksums = old_checksums(path, bottle_hash, args: args)
+ update_or_add = checksums.nil? ? "add" : "update"
+
+ checksums&.each(&bottle.method(:sha256))
+ output = bottle_output(bottle)
+ puts output
Utils::Inreplace.inreplace(path) do |s|
formula_contents = s.inreplace_string
- bottle_node = Utils::AST.bottle_block(formula_contents)
- if bottle_node.present?
- update_or_add = "update"
- if args.keep_old?
- old_keys = Utils::AST.body_children(bottle_node.body).map(&:method_name)
- old_bottle_spec = Formulary.factory(path).bottle_specification
- mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"])
- if mismatches.present?
- odie <<~EOS
- --keep-old was passed but there are changes in:
- #{mismatches.join("\n")}
- EOS
- end
- checksums.each { |cksum| bottle.sha256(cksum) }
- output = bottle_output bottle
- end
- puts output
+ case update_or_add
+ when "update"
Utils::AST.replace_bottle_stanza!(formula_contents, output)
- else
- odie "--keep-old was passed but there was no existing bottle block!" if args.keep_old?
- puts output
- update_or_add = "add"
+ when "add"
Utils::AST.add_bottle_stanza!(formula_contents, output)
end
end
@@ -537,7 +522,7 @@ def merge(args:)
end
end
else
- puts output
+ puts bottle_output(bottle)
end
end
end
@@ -564,7 +549,7 @@ def merge_bottle_spec(old_keys, old_bottle_spec, new_bottle_hash)
mismatches << "#{key}: old: #{old_value.inspect}, new: #{new_value.inspect}"
end
- return [mismatches, checksums] unless old_keys.include? :sha256
+ return [mismatches, checksums] if old_keys.exclude? :sha256
old_bottle_spec.collector.each_key do |tag|
old_value = old_bottle_spec.collector[tag].hexdigest
@@ -578,4 +563,24 @@ def merge_bottle_spec(old_keys, old_bottle_spec, new_bottle_hash)
[mismatches, checksums]
end
+
+ def old_checksums(formula_path, bottle_hash, args:)
+ bottle_node = Utils::AST.bottle_block(formula_path.read)
+ if bottle_node.nil?
+ odie "--keep-old was passed but there was no existing bottle block!" if args.keep_old?
+ return
+ end
+ return [] unless args.keep_old?
+
+ old_keys = Utils::AST.body_children(bottle_node.body).map(&:method_name)
+ old_bottle_spec = Formulary.factory(formula_path).bottle_specification
+ mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"])
+ if mismatches.present?
+ odie <<~EOS
+ --keep-old was passed but there are changes in:
+ #{mismatches.join("\n")}
+ EOS
+ end
+ checksums
+ end
end | false |
Other | Homebrew | brew | 7d9f05153401e5e0a7bfb2af8e68b0e9a95cca5c.json | Update RBI files for rubocop-performance. | Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.9.2.rbi | @@ -630,15 +630,13 @@ class RuboCop::Cop::Performance::ReverseEach < ::RuboCop::Cop::Base
private
- def replacement_range(node); end
+ def offense_range(node); end
end
RuboCop::Cop::Performance::ReverseEach::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::ReverseEach::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
-RuboCop::Cop::Performance::ReverseEach::UNDERSCORE = T.let(T.unsafe(nil), String)
-
class RuboCop::Cop::Performance::ReverseFirst < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector) | true |
Other | Homebrew | brew | 7d9f05153401e5e0a7bfb2af8e68b0e9a95cca5c.json | Update RBI files for rubocop-performance. | Library/Homebrew/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `ruby-progressbar` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
+# Please instead update this file by running `tapioca sync`.
# typed: true
@@ -47,27 +47,27 @@ class ProgressBar::Base
protected
def autofinish; end
- def autofinish=(_); end
+ def autofinish=(_arg0); end
def autostart; end
- def autostart=(_); end
+ def autostart=(_arg0); end
def bar; end
- def bar=(_); end
+ def bar=(_arg0); end
def finished; end
- def finished=(_); end
+ def finished=(_arg0); end
def output; end
- def output=(_); end
+ def output=(_arg0); end
def percentage; end
- def percentage=(_); end
+ def percentage=(_arg0); end
def progressable; end
- def progressable=(_); end
+ def progressable=(_arg0); end
def rate; end
- def rate=(_); end
+ def rate=(_arg0); end
def time; end
- def time=(_); end
+ def time=(_arg0); end
def timer; end
- def timer=(_); end
+ def timer=(_arg0); end
def title_comp; end
- def title_comp=(_); end
+ def title_comp=(_arg0); end
def update_progress(*args); end
end
@@ -79,13 +79,13 @@ class ProgressBar::Calculators::Length
def calculate_length; end
def current_length; end
- def current_length=(_); end
+ def current_length=(_arg0); end
def length; end
def length_changed?; end
def length_override; end
def length_override=(other); end
def output; end
- def output=(_); end
+ def output=(_arg0); end
def reset_length; end
private
@@ -113,16 +113,16 @@ class ProgressBar::Components::Bar
def initialize(options = T.unsafe(nil)); end
def length; end
- def length=(_); end
+ def length=(_arg0); end
def progress; end
- def progress=(_); end
+ def progress=(_arg0); end
def progress_mark; end
- def progress_mark=(_); end
+ def progress_mark=(_arg0); end
def remainder_mark; end
- def remainder_mark=(_); end
+ def remainder_mark=(_arg0); end
def to_s(options = T.unsafe(nil)); end
def upa_steps; end
- def upa_steps=(_); end
+ def upa_steps=(_arg0); end
private
@@ -149,7 +149,7 @@ class ProgressBar::Components::Percentage
def initialize(options = T.unsafe(nil)); end
def progress; end
- def progress=(_); end
+ def progress=(_arg0); end
private
@@ -163,15 +163,15 @@ class ProgressBar::Components::Rate
def initialize(options = T.unsafe(nil)); end
def progress; end
- def progress=(_); end
+ def progress=(_arg0); end
def rate_scale; end
- def rate_scale=(_); end
+ def rate_scale=(_arg0); end
def started_at; end
- def started_at=(_); end
+ def started_at=(_arg0); end
def stopped_at; end
- def stopped_at=(_); end
+ def stopped_at=(_arg0); end
def timer; end
- def timer=(_); end
+ def timer=(_arg0); end
private
@@ -196,17 +196,16 @@ class ProgressBar::Components::Time
def out_of_bounds_time_format; end
def out_of_bounds_time_format=(format); end
def progress; end
- def progress=(_); end
+ def progress=(_arg0); end
def timer; end
- def timer=(_); end
+ def timer=(_arg0); end
private
def elapsed; end
def estimated; end
def estimated_seconds_remaining; end
def estimated_with_elapsed_fallback; end
- def out_of_bounds_time; end
end
ProgressBar::Components::Time::ELAPSED_LABEL = T.let(T.unsafe(nil), String)
@@ -219,6 +218,8 @@ ProgressBar::Components::Time::OOB_FRIENDLY_TIME_TEXT = T.let(T.unsafe(nil), Str
ProgressBar::Components::Time::OOB_LIMIT_IN_HOURS = T.let(T.unsafe(nil), Integer)
+ProgressBar::Components::Time::OOB_TEXT_TO_FORMAT = T.let(T.unsafe(nil), Hash)
+
ProgressBar::Components::Time::OOB_TIME_FORMATS = T.let(T.unsafe(nil), Array)
ProgressBar::Components::Time::OOB_UNKNOWN_TIME_TEXT = T.let(T.unsafe(nil), String)
@@ -229,7 +230,7 @@ class ProgressBar::Components::Title
def initialize(options = T.unsafe(nil)); end
def title; end
- def title=(_); end
+ def title=(_arg0); end
end
ProgressBar::Components::Title::DEFAULT_TITLE = T.let(T.unsafe(nil), String)
@@ -249,10 +250,10 @@ class ProgressBar::Format::Molecule
def bar_molecule?; end
def full_key; end
def key; end
- def key=(_); end
+ def key=(_arg0); end
def lookup_value(environment, length = T.unsafe(nil)); end
def method_name; end
- def method_name=(_); end
+ def method_name=(_arg0); end
def non_bar_molecule?; end
end
@@ -283,17 +284,17 @@ class ProgressBar::Output
def log(string); end
def refresh(options = T.unsafe(nil)); end
def stream; end
- def stream=(_); end
+ def stream=(_arg0); end
def with_refresh; end
protected
def bar; end
- def bar=(_); end
+ def bar=(_arg0); end
def length_calculator; end
- def length_calculator=(_); end
+ def length_calculator=(_arg0); end
def throttle; end
- def throttle=(_); end
+ def throttle=(_arg0); end
private
@@ -315,12 +316,12 @@ class ProgressBar::Outputs::NonTty < ::ProgressBar::Output
def default_format; end
def eol; end
def last_update_length; end
- def refresh_with_format_change(*_); end
- def resolve_format(*_); end
+ def refresh_with_format_change(*_arg0); end
+ def resolve_format(*_arg0); end
protected
- def last_update_length=(_); end
+ def last_update_length=(_arg0); end
end
ProgressBar::Outputs::NonTty::DEFAULT_FORMAT_STRING = T.let(T.unsafe(nil), String)
@@ -351,12 +352,12 @@ class ProgressBar::Progress
def progress=(new_progress); end
def reset; end
def running_average; end
- def running_average=(_); end
+ def running_average=(_arg0); end
def smoothing; end
- def smoothing=(_); end
+ def smoothing=(_arg0); end
def start(options = T.unsafe(nil)); end
def starting_position; end
- def starting_position=(_); end
+ def starting_position=(_arg0); end
def total; end
def total=(new_total); end
def total_with_unknown_indicator; end
@@ -380,13 +381,13 @@ class ProgressBar::Throttle
def choke(options = T.unsafe(nil)); end
def rate; end
- def rate=(_); end
+ def rate=(_arg0); end
def started_at; end
- def started_at=(_); end
+ def started_at=(_arg0); end
def stopped_at; end
- def stopped_at=(_); end
+ def stopped_at=(_arg0); end
def timer; end
- def timer=(_); end
+ def timer=(_arg0); end
end
class ProgressBar::Time
@@ -398,7 +399,7 @@ class ProgressBar::Time
protected
def time; end
- def time=(_); end
+ def time=(_arg0); end
end
ProgressBar::Time::TIME_MOCKING_LIBRARY_METHODS = T.let(T.unsafe(nil), Array)
@@ -417,14 +418,14 @@ class ProgressBar::Timer
def start; end
def started?; end
def started_at; end
- def started_at=(_); end
+ def started_at=(_arg0); end
def stop; end
def stopped?; end
def stopped_at; end
- def stopped_at=(_); end
+ def stopped_at=(_arg0); end
protected
def time; end
- def time=(_); end
+ def time=(_arg0); end
end | true |
Other | Homebrew | brew | 4cbd4f296bd101ba17b94b1e9383fc5d7f5ba5fd.json | bottle: add tests for `merge_bottle_spec` | Library/Homebrew/dev-cmd/bottle.rb | @@ -549,24 +549,26 @@ def merge_bottle_spec(old_keys, old_bottle_spec, new_bottle_hash)
new_values = {
root_url: new_bottle_hash["root_url"],
prefix: new_bottle_hash["prefix"],
- cellar: new_bottle_hash["cellar"].to_sym,
+ cellar: new_bottle_hash["cellar"],
rebuild: new_bottle_hash["rebuild"],
}
old_keys.each do |key|
next if key == :sha256
- old_value = old_bottle_spec.send(key)
- new_value = new_values[key]
- next if key == :cellar && old_value == :any && new_value == :any_skip_relocation
+ old_value = old_bottle_spec.send(key).to_s
+ new_value = new_values[key].to_s
+ next if key == :cellar && old_value == "any" && new_value == "any_skip_relocation"
next if old_value.present? && new_value == old_value
mismatches << "#{key}: old: #{old_value.inspect}, new: #{new_value.inspect}"
end
+ return [mismatches, checksums] unless old_keys.include? :sha256
+
old_bottle_spec.collector.each_key do |tag|
old_value = old_bottle_spec.collector[tag].hexdigest
- new_value = new_bottle_hash["tags"][tag.to_s]
+ new_value = new_bottle_hash.dig("tags", tag.to_s)
if new_value.present?
mismatches << "sha256 => #{tag}"
else | true |
Other | Homebrew | brew | 4cbd4f296bd101ba17b94b1e9383fc5d7f5ba5fd.json | bottle: add tests for `merge_bottle_spec` | Library/Homebrew/test/dev-cmd/bottle_spec.rb | @@ -173,6 +173,66 @@ def stub_hash(parameters)
"d9cc50eec8ac243148a121049c236cba06af4a0b1156ab397d0a2850aa79c137",
)
end
+
+ describe "#merge_bottle_spec" do
+ it "allows new bottle hash to be empty" do
+ valid_keys = [:root_url, :prefix, :cellar, :rebuild, :sha256]
+ old_spec = BottleSpecification.new
+ old_spec.sha256("f59bc65c91e4e698f6f050e1efea0040f57372d4dcf0996cbb8f97ced320403b" => :big_sur)
+ expect { homebrew.merge_bottle_spec(valid_keys, old_spec, {}) }.not_to raise_error
+ end
+
+ it "checks for conflicting root URL" do
+ old_spec = BottleSpecification.new
+ old_spec.root_url("https://failbrew.bintray.com/bottles")
+ new_hash = { "root_url" => "https://testbrew.bintray.com/bottles" }
+ expect(homebrew.merge_bottle_spec([:root_url], old_spec, new_hash)).to eq [
+ ['root_url: old: "https://failbrew.bintray.com/bottles", new: "https://testbrew.bintray.com/bottles"'],
+ [],
+ ]
+ end
+
+ it "checks for conflicting prefix" do
+ old_spec = BottleSpecification.new
+ old_spec.prefix("/opt/failbrew")
+ new_hash = { "prefix" => "/opt/testbrew" }
+ expect(homebrew.merge_bottle_spec([:prefix], old_spec, new_hash)).to eq [
+ ['prefix: old: "/opt/failbrew", new: "/opt/testbrew"'],
+ [],
+ ]
+ end
+
+ it "checks for conflicting cellar" do
+ old_spec = BottleSpecification.new
+ old_spec.cellar("/opt/failbrew/Cellar")
+ new_hash = { "cellar" => "/opt/testbrew/Cellar" }
+ expect(homebrew.merge_bottle_spec([:cellar], old_spec, new_hash)).to eq [
+ ['cellar: old: "/opt/failbrew/Cellar", new: "/opt/testbrew/Cellar"'],
+ [],
+ ]
+ end
+
+ it "checks for conflicting rebuild number" do
+ old_spec = BottleSpecification.new
+ old_spec.rebuild(1)
+ new_hash = { "rebuild" => 2 }
+ expect(homebrew.merge_bottle_spec([:rebuild], old_spec, new_hash)).to eq [
+ ['rebuild: old: "1", new: "2"'],
+ [],
+ ]
+ end
+
+ it "checks for conflicting checksums" do
+ old_spec = BottleSpecification.new
+ old_spec.sha256("109c0cb581a7b5d84da36d84b221fb9dd0f8a927b3044d82611791c9907e202e" => :catalina)
+ old_spec.sha256("7571772bf7a0c9fe193e70e521318b53993bee6f351976c9b6e01e00d13d6c3f" => :mojave)
+ new_hash = { "tags" => { "catalina" => "ec6d7f08412468f28dee2be17ad8cd8b883b16b34329efcecce019b8c9736428" } }
+ expect(homebrew.merge_bottle_spec([:sha256], old_spec, new_hash)).to eq [
+ ["sha256 => catalina"],
+ [{ "7571772bf7a0c9fe193e70e521318b53993bee6f351976c9b6e01e00d13d6c3f" => :mojave }],
+ ]
+ end
+ end
end
describe "brew bottle --merge", :integration_test, :needs_linux do | true |
Other | Homebrew | brew | 86fee106a3b042ccd8c1c207a93f1cf0dfa8bd5a.json | livecheck: strengthen URL patterns | Library/Homebrew/livecheck/strategy/gnome.rb | @@ -20,7 +20,7 @@ class Gnome
NICE_NAME = "GNOME"
# The `Regexp` used to determine if the strategy applies to the URL.
- URL_MATCH_REGEX = /download\.gnome\.org/i.freeze
+ URL_MATCH_REGEX = %r{^https?://download\.gnome\.org/sources/[^/]+/}i.freeze
# Whether the strategy can be applied to the provided URL.
#
@@ -37,7 +37,7 @@ def self.match?(url)
# @param regex [Regexp] a regex used for matching versions in content
# @return [Hash]
def self.find_versions(url, regex = nil, &block)
- %r{/sources/(?<package_name>.*?)/}i =~ url
+ %r{/sources/(?<package_name>[^/]+)/}i =~ url
page_url = "https://download.gnome.org/sources/#{package_name}/cache.json"
| true |
Other | Homebrew | brew | 86fee106a3b042ccd8c1c207a93f1cf0dfa8bd5a.json | livecheck: strengthen URL patterns | Library/Homebrew/livecheck/strategy/hackage.rb | @@ -18,7 +18,7 @@ module Strategy
# @api public
class Hackage
# The `Regexp` used to determine if the strategy applies to the URL.
- URL_MATCH_REGEX = /(?:downloads|hackage)\.haskell\.org/i.freeze
+ URL_MATCH_REGEX = %r{^https?://(?:downloads|hackage)\.haskell\.org(?:/[^/]+){3}}i.freeze
# Whether the strategy can be applied to the provided URL.
# | true |
Other | Homebrew | brew | 86fee106a3b042ccd8c1c207a93f1cf0dfa8bd5a.json | livecheck: strengthen URL patterns | Library/Homebrew/livecheck/strategy/npm.rb | @@ -20,7 +20,7 @@ class Npm
NICE_NAME = "npm"
# The `Regexp` used to determine if the strategy applies to the URL.
- URL_MATCH_REGEX = /registry\.npmjs\.org/i.freeze
+ URL_MATCH_REGEX = %r{^https?://registry\.npmjs\.org(?:/[^/]+)?/[^/]+/-/}i.freeze
# Whether the strategy can be applied to the provided URL.
#
@@ -37,7 +37,7 @@ def self.match?(url)
# @param regex [Regexp] a regex used for matching versions in content
# @return [Hash]
def self.find_versions(url, regex = nil, &block)
- %r{registry\.npmjs\.org/(?<package_name>.+)/-/}i =~ url
+ %r{registry\.npmjs\.org/(?<package_name>(?:[^/]+/)?[^/]+)/-/}i =~ url
page_url = "https://www.npmjs.com/package/#{package_name}?activeTab=versions"
| true |
Other | Homebrew | brew | 86fee106a3b042ccd8c1c207a93f1cf0dfa8bd5a.json | livecheck: strengthen URL patterns | Library/Homebrew/livecheck/strategy/pypi.rb | @@ -20,7 +20,7 @@ class Pypi
NICE_NAME = "PyPI"
# The `Regexp` used to determine if the strategy applies to the URL.
- URL_MATCH_REGEX = /files\.pythonhosted\.org/i.freeze
+ URL_MATCH_REGEX = %r{^https?://files\.pythonhosted\.org/packages(?:/[^/]+){4}i}.freeze
# Whether the strategy can be applied to the provided URL.
# | true |
Other | Homebrew | brew | 86fee106a3b042ccd8c1c207a93f1cf0dfa8bd5a.json | livecheck: strengthen URL patterns | Library/Homebrew/test/livecheck/strategy/hackage_spec.rb | @@ -7,11 +7,13 @@
subject(:hackage) { described_class }
let(:hackage_url) { "https://hackage.haskell.org/package/abc-1.2.3/def-1.2.3.tar.gz" }
+ let(:hackage_downloads_url) { "https://downloads.haskell.org/~abc/1.2.3/def-1.2.3-src.tar.xz" }
let(:non_hackage_url) { "https://brew.sh/test" }
describe "::match?" do
it "returns true if the argument provided is a Hackage URL" do
expect(hackage.match?(hackage_url)).to be true
+ expect(hackage.match?(hackage_downloads_url)).to be true
end
it "returns false if the argument provided is not a Hackage URL" do | true |
Other | Homebrew | brew | 86fee106a3b042ccd8c1c207a93f1cf0dfa8bd5a.json | livecheck: strengthen URL patterns | Library/Homebrew/test/livecheck/strategy/npm_spec.rb | @@ -7,11 +7,13 @@
subject(:npm) { described_class }
let(:npm_url) { "https://registry.npmjs.org/abc/-/def-1.2.3.tgz" }
+ let(:npm_scoped_url) { "https://registry.npmjs.org/@example/abc/-/def-1.2.3.tgz" }
let(:non_npm_url) { "https://brew.sh/test" }
describe "::match?" do
it "returns true if the argument provided is an npm URL" do
expect(npm.match?(npm_url)).to be true
+ expect(npm.match?(npm_scoped_url)).to be true
end
it "returns false if the argument provided is not an npm URL" do | true |
Other | Homebrew | brew | 7ab50ef6f611b88915112b8b96db93f198e43e1a.json | rubocops/homepage: fix frozen string error. | Library/Homebrew/rubocops/homepage.rb | @@ -89,7 +89,7 @@ def autocorrect(node)
lambda do |corrector|
return if node.nil?
- homepage = string_content(node)
+ homepage = string_content(node).dup
homepage.sub!("readthedocs.org", "readthedocs.io")
homepage.delete_suffix!(".git") if homepage.start_with?("https://github.com")
corrector.replace(node.source_range, "\"#{homepage}\"") | false |
Other | Homebrew | brew | 7cc48a03d5c69ddb5e3504baf2fb5c2ef8863e50.json | rubocop: exclude new cop.
This doesn't look good for DSLs. | Library/.rubocop.yml | @@ -54,6 +54,14 @@ FormulaAudit:
FormulaAuditStrict:
Enabled: true
+# makes DSL usage ugly.
+Layout/SpaceBeforeBrackets:
+ Exclude:
+ - "**/*_spec.rb"
+ - "Taps/*/*/*.rb"
+ - "/**/{Formula,Casks}/*.rb"
+ - "**/{Formula,Casks}/*.rb"
+
# Use `<<~` for heredocs.
Layout/HeredocIndentation:
Enabled: true | false |
Other | Homebrew | brew | ec23ba0b363bf2b6c14278a996fa00d4525129e8.json | rubocop.yml: require relevant gems.
This avoids RuboCop erroring out. | Library/.rubocop.yml | @@ -1,6 +1,9 @@
# TODO: Try getting more rules in sync.
-require: ./Homebrew/rubocops.rb
+require:
+ - ./Homebrew/rubocops.rb
+ - rubocop-performance
+ - rubocop-rails
inherit_mode:
merge: | false |
Other | Homebrew | brew | 59360930d32fb66fb5de4f135e793deb97495566.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/parser@3.0.0.0.rbi | @@ -76,6 +76,7 @@ class Parser::AST::Processor < ::AST::Processor
def on_ivar(node); end
def on_ivasgn(node); end
def on_kwarg(node); end
+ def on_kwargs(node); end
def on_kwbegin(node); end
def on_kwoptarg(node); end
def on_kwrestarg(node); end
@@ -87,6 +88,8 @@ class Parser::AST::Processor < ::AST::Processor
def on_match_alt(node); end
def on_match_as(node); end
def on_match_current_line(node); end
+ def on_match_pattern(node); end
+ def on_match_pattern_p(node); end
def on_match_rest(node); end
def on_match_var(node); end
def on_match_with_lvasgn(node); end
@@ -142,6 +145,7 @@ class Parser::Base < ::Racc::Parser
def context; end
def current_arg_stack; end
def diagnostics; end
+ def lexer; end
def max_numparam_stack; end
def parse(source_buffer); end
def parse_with_comments(source_buffer); end
@@ -226,7 +230,7 @@ class Parser::Builders::Default
def def_sclass(class_t, lshft_t, expr, body, end_t); end
def def_singleton(def_t, definee, dot_t, name_t, args, body, end_t); end
def emit_file_line_as_literals; end
- def emit_file_line_as_literals=(_); end
+ def emit_file_line_as_literals=(_arg0); end
def false(false_t); end
def find_pattern(lbrack_t, elements, rbrack_t); end
def float(float_t); end
@@ -261,12 +265,13 @@ class Parser::Builders::Default
def match_nil_pattern(dstar_t, nil_t); end
def match_op(receiver, match_t, arg); end
def match_pair(label_type, label, value); end
+ def match_pattern(lhs, match_t, rhs); end
+ def match_pattern_p(lhs, match_t, rhs); end
def match_rest(star_t, name_t = T.unsafe(nil)); end
def match_var(name_t); end
def match_with_trailing_comma(match, comma_t); end
def multi_assign(lhs, eql_t, rhs); end
def multi_lhs(begin_t, items, end_t); end
- def multi_rassign(lhs, assoc_t, rhs); end
def nil(nil_t); end
def not_op(not_t, begin_t = T.unsafe(nil), receiver = T.unsafe(nil), end_t = T.unsafe(nil)); end
def nth_ref(token); end
@@ -281,14 +286,13 @@ class Parser::Builders::Default
def pair_list_18(list); end
def pair_quoted(begin_t, parts, end_t, value); end
def parser; end
- def parser=(_); end
+ def parser=(_arg0); end
def pin(pin_t, var); end
def postexe(postexe_t, lbrace_t, compstmt, rbrace_t); end
def preexe(preexe_t, lbrace_t, compstmt, rbrace_t); end
def procarg0(arg); end
def range_exclusive(lhs, dot3_t, rhs); end
def range_inclusive(lhs, dot2_t, rhs); end
- def rassign(lhs, assoc_t, rhs); end
def rational(rational_t); end
def regexp_compose(begin_t, parts, end_t, options); end
def regexp_options(regopt_t); end
@@ -347,6 +351,7 @@ class Parser::Builders::Default
def keyword_map(keyword_t, begin_t, args, end_t); end
def keyword_mod_map(pre_e, keyword_t, post_e); end
def kwarg_map(name_t, value_e = T.unsafe(nil)); end
+ def kwargs?(node); end
def loc(token); end
def module_definition_map(keyword_t, name_e, operator_t, end_t); end
def n(type, children, source_map); end
@@ -358,6 +363,7 @@ class Parser::Builders::Default
def range_map(start_e, op_t, end_e); end
def regexp_map(begin_t, end_t, options_e); end
def rescue_body_map(keyword_t, exc_list_e, assoc_t, exc_var_e, then_t, compstmt_e); end
+ def rewrite_hash_args_to_kwargs(args); end
def send_binary_op_map(lhs_e, selector_t, rhs_e); end
def send_index_map(receiver_e, lbrack_t, rbrack_t); end
def send_map(receiver_e, dot_t, selector_t, begin_t = T.unsafe(nil), args = T.unsafe(nil), end_t = T.unsafe(nil)); end
@@ -378,17 +384,21 @@ class Parser::Builders::Default
class << self
def emit_arg_inside_procarg0; end
- def emit_arg_inside_procarg0=(_); end
+ def emit_arg_inside_procarg0=(_arg0); end
def emit_encoding; end
- def emit_encoding=(_); end
+ def emit_encoding=(_arg0); end
def emit_forward_arg; end
- def emit_forward_arg=(_); end
+ def emit_forward_arg=(_arg0); end
def emit_index; end
- def emit_index=(_); end
+ def emit_index=(_arg0); end
+ def emit_kwargs; end
+ def emit_kwargs=(_arg0); end
def emit_lambda; end
- def emit_lambda=(_); end
+ def emit_lambda=(_arg0); end
+ def emit_match_pattern; end
+ def emit_match_pattern=(_arg0); end
def emit_procarg0; end
- def emit_procarg0=(_); end
+ def emit_procarg0=(_arg0); end
def modernize; end
end
end
@@ -401,6 +411,7 @@ class Parser::Context
def class_definition_allowed?; end
def dynamic_const_definition_allowed?; end
+ def empty?; end
def in_block?; end
def in_class?; end
def in_dynamic_block?; end
@@ -416,6 +427,7 @@ end
class Parser::CurrentArgStack
def initialize; end
+ def empty?; end
def pop; end
def push(value); end
def reset; end
@@ -428,7 +440,7 @@ Parser::CurrentRuby = Parser::Ruby26
module Parser::Deprecation
def warn_of_deprecation; end
- def warned_of_deprecation=(_); end
+ def warned_of_deprecation=(_arg0); end
end
class Parser::Diagnostic
@@ -453,11 +465,11 @@ class Parser::Diagnostic::Engine
def initialize(consumer = T.unsafe(nil)); end
def all_errors_are_fatal; end
- def all_errors_are_fatal=(_); end
+ def all_errors_are_fatal=(_arg0); end
def consumer; end
- def consumer=(_); end
+ def consumer=(_arg0); end
def ignore_warnings; end
- def ignore_warnings=(_); end
+ def ignore_warnings=(_arg0); end
def process(diagnostic); end
protected
@@ -473,23 +485,27 @@ class Parser::Lexer
def advance; end
def cmdarg; end
- def cmdarg=(_); end
+ def cmdarg=(_arg0); end
+ def cmdarg_stack; end
def command_start; end
- def command_start=(_); end
+ def command_start=(_arg0); end
def comments; end
- def comments=(_); end
+ def comments=(_arg0); end
def cond; end
- def cond=(_); end
+ def cond=(_arg0); end
+ def cond_stack; end
def context; end
- def context=(_); end
+ def context=(_arg0); end
def dedent_level; end
def diagnostics; end
- def diagnostics=(_); end
+ def diagnostics=(_arg0); end
def encoding; end
def force_utf32; end
- def force_utf32=(_); end
+ def force_utf32=(_arg0); end
def in_kwarg; end
- def in_kwarg=(_); end
+ def in_kwarg=(_arg0); end
+ def lambda_stack; end
+ def paren_nest; end
def pop_cmdarg; end
def pop_cond; end
def push_cmdarg; end
@@ -500,9 +516,9 @@ class Parser::Lexer
def state; end
def state=(state); end
def static_env; end
- def static_env=(_); end
+ def static_env=(_arg0); end
def tokens; end
- def tokens=(_); end
+ def tokens=(_arg0); end
protected
@@ -525,78 +541,78 @@ class Parser::Lexer
class << self
def lex_en_expr_arg; end
- def lex_en_expr_arg=(_); end
+ def lex_en_expr_arg=(_arg0); end
def lex_en_expr_beg; end
- def lex_en_expr_beg=(_); end
+ def lex_en_expr_beg=(_arg0); end
def lex_en_expr_cmdarg; end
- def lex_en_expr_cmdarg=(_); end
+ def lex_en_expr_cmdarg=(_arg0); end
def lex_en_expr_dot; end
- def lex_en_expr_dot=(_); end
+ def lex_en_expr_dot=(_arg0); end
def lex_en_expr_end; end
- def lex_en_expr_end=(_); end
+ def lex_en_expr_end=(_arg0); end
def lex_en_expr_endarg; end
- def lex_en_expr_endarg=(_); end
+ def lex_en_expr_endarg=(_arg0); end
def lex_en_expr_endfn; end
- def lex_en_expr_endfn=(_); end
+ def lex_en_expr_endfn=(_arg0); end
def lex_en_expr_fname; end
- def lex_en_expr_fname=(_); end
+ def lex_en_expr_fname=(_arg0); end
def lex_en_expr_labelarg; end
- def lex_en_expr_labelarg=(_); end
+ def lex_en_expr_labelarg=(_arg0); end
def lex_en_expr_mid; end
- def lex_en_expr_mid=(_); end
+ def lex_en_expr_mid=(_arg0); end
def lex_en_expr_value; end
- def lex_en_expr_value=(_); end
+ def lex_en_expr_value=(_arg0); end
def lex_en_expr_variable; end
- def lex_en_expr_variable=(_); end
+ def lex_en_expr_variable=(_arg0); end
def lex_en_interp_backslash_delimited; end
- def lex_en_interp_backslash_delimited=(_); end
+ def lex_en_interp_backslash_delimited=(_arg0); end
def lex_en_interp_backslash_delimited_words; end
- def lex_en_interp_backslash_delimited_words=(_); end
+ def lex_en_interp_backslash_delimited_words=(_arg0); end
def lex_en_interp_string; end
- def lex_en_interp_string=(_); end
+ def lex_en_interp_string=(_arg0); end
def lex_en_interp_words; end
- def lex_en_interp_words=(_); end
+ def lex_en_interp_words=(_arg0); end
def lex_en_leading_dot; end
- def lex_en_leading_dot=(_); end
+ def lex_en_leading_dot=(_arg0); end
def lex_en_line_begin; end
- def lex_en_line_begin=(_); end
+ def lex_en_line_begin=(_arg0); end
def lex_en_line_comment; end
- def lex_en_line_comment=(_); end
+ def lex_en_line_comment=(_arg0); end
def lex_en_plain_backslash_delimited; end
- def lex_en_plain_backslash_delimited=(_); end
+ def lex_en_plain_backslash_delimited=(_arg0); end
def lex_en_plain_backslash_delimited_words; end
- def lex_en_plain_backslash_delimited_words=(_); end
+ def lex_en_plain_backslash_delimited_words=(_arg0); end
def lex_en_plain_string; end
- def lex_en_plain_string=(_); end
+ def lex_en_plain_string=(_arg0); end
def lex_en_plain_words; end
- def lex_en_plain_words=(_); end
+ def lex_en_plain_words=(_arg0); end
def lex_en_regexp_modifiers; end
- def lex_en_regexp_modifiers=(_); end
+ def lex_en_regexp_modifiers=(_arg0); end
def lex_error; end
- def lex_error=(_); end
+ def lex_error=(_arg0); end
def lex_start; end
- def lex_start=(_); end
+ def lex_start=(_arg0); end
private
def _lex_eof_trans; end
- def _lex_eof_trans=(_); end
+ def _lex_eof_trans=(_arg0); end
def _lex_from_state_actions; end
- def _lex_from_state_actions=(_); end
+ def _lex_from_state_actions=(_arg0); end
def _lex_index_offsets; end
- def _lex_index_offsets=(_); end
+ def _lex_index_offsets=(_arg0); end
def _lex_indicies; end
- def _lex_indicies=(_); end
+ def _lex_indicies=(_arg0); end
def _lex_key_spans; end
- def _lex_key_spans=(_); end
+ def _lex_key_spans=(_arg0); end
def _lex_to_state_actions; end
- def _lex_to_state_actions=(_); end
+ def _lex_to_state_actions=(_arg0); end
def _lex_trans_actions; end
- def _lex_trans_actions=(_); end
+ def _lex_trans_actions=(_arg0); end
def _lex_trans_keys; end
- def _lex_trans_keys=(_); end
+ def _lex_trans_keys=(_arg0); end
def _lex_trans_targs; end
- def _lex_trans_targs=(_); end
+ def _lex_trans_targs=(_arg0); end
end
end
@@ -636,7 +652,7 @@ class Parser::Lexer::Literal
def plain_heredoc?; end
def regexp?; end
def saved_herebody_s; end
- def saved_herebody_s=(_); end
+ def saved_herebody_s=(_arg0); end
def squiggly_heredoc?; end
def start_interp_brace; end
def str_s; end
@@ -681,6 +697,7 @@ Parser::MESSAGES = T.let(T.unsafe(nil), Hash)
class Parser::MaxNumparamStack
def initialize; end
+ def empty?; end
def has_numparams?; end
def has_ordinary_params!; end
def has_ordinary_params?; end
@@ -695,6 +712,8 @@ class Parser::MaxNumparamStack
def set(value); end
end
+Parser::MaxNumparamStack::ORDINARY_PARAMS = T.let(T.unsafe(nil), Integer)
+
module Parser::Messages
class << self
def compile(reason, arguments); end
@@ -709,7 +728,7 @@ Parser::Meta::NODE_TYPES = T.let(T.unsafe(nil), Set)
class Parser::Rewriter < ::Parser::AST::Processor
extend(::Parser::Deprecation)
- def initialize(*_); end
+ def initialize(*_arg0); end
def assignment?(node); end
def insert_after(range, content); end
@@ -1174,6 +1193,7 @@ class Parser::Source::Buffer
def column_for_position(position); end
def decompose_position(position); end
def first_line; end
+ def freeze; end
def last_line; end
def line_for_position(position); end
def line_range(lineno); end
@@ -1189,8 +1209,9 @@ class Parser::Source::Buffer
private
+ def bsearch(line_begins, position); end
def line_begins; end
- def line_for(position); end
+ def line_index_for_position(position); end
class << self
def recognize_encoding(string); end
@@ -1224,7 +1245,7 @@ class Parser::Source::Comment::Associator
def associate; end
def associate_locations; end
def skip_directives; end
- def skip_directives=(_); end
+ def skip_directives=(_arg0); end
private
@@ -1430,7 +1451,7 @@ class Parser::Source::Range
def empty?; end
def end; end
def end_pos; end
- def eql?(_); end
+ def eql?(_arg0); end
def first_line; end
def hash; end
def inspect; end
@@ -1594,6 +1615,7 @@ class Parser::StaticEnvironment
def declare_forward_args; end
def declared?(name); end
def declared_forward_args?; end
+ def empty?; end
def extend_dynamic; end
def extend_static; end
def reset; end
@@ -1625,6 +1647,7 @@ class Parser::VariablesStack
def declare(name); end
def declared?(name); end
+ def empty?; end
def pop; end
def push; end
def reset; end | true |
Other | Homebrew | brew | 59360930d32fb66fb5de4f135e793deb97495566.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.0.3.rbi | @@ -390,7 +390,7 @@ end
class Regexp::Expression::FreeSpace < ::Regexp::Expression::Base
def match_length; end
- def quantify(token, text, min = T.unsafe(nil), max = T.unsafe(nil), mode = T.unsafe(nil)); end
+ def quantify(_token, _text, _min = T.unsafe(nil), _max = T.unsafe(nil), _mode = T.unsafe(nil)); end
end
module Regexp::Expression::Group
@@ -440,6 +440,8 @@ class Regexp::Expression::Group::Options < ::Regexp::Expression::Group::Base
end
class Regexp::Expression::Group::Passive < ::Regexp::Expression::Group::Base
+ def initialize(*_arg0); end
+
def implicit=(_arg0); end
def implicit?; end
def to_s(format = T.unsafe(nil)); end
@@ -528,12 +530,12 @@ class Regexp::Expression::Subexpression < ::Regexp::Expression::Base
def at(*args, &block); end
def dig(*indices); end
def each(*args, &block); end
- def each_expression(include_self = T.unsafe(nil), &block); end
+ def each_expression(include_self = T.unsafe(nil)); end
def empty?(*args, &block); end
def expressions; end
def expressions=(_arg0); end
def fetch(*args, &block); end
- def flat_map(include_self = T.unsafe(nil), &block); end
+ def flat_map(include_self = T.unsafe(nil)); end
def index(*args, &block); end
def inner_match_length; end
def join(*args, &block); end
@@ -833,7 +835,7 @@ class Regexp::MatchLength
def initialize(exp, opts = T.unsafe(nil)); end
def each(opts = T.unsafe(nil)); end
- def endless_each(&block); end
+ def endless_each; end
def fixed?; end
def include?(length); end
def inspect; end
@@ -1052,8 +1054,8 @@ end
class Regexp::Syntax::Any < ::Regexp::Syntax::Base
def initialize; end
- def implements!(type, token); end
- def implements?(type, token); end
+ def implements!(_type, _token); end
+ def implements?(_type, _token); end
end
class Regexp::Syntax::Base
@@ -1078,11 +1080,11 @@ class Regexp::Syntax::Base
end
end
-class Regexp::Syntax::InvalidVersionNameError < ::SyntaxError
+class Regexp::Syntax::InvalidVersionNameError < ::Regexp::Syntax::SyntaxError
def initialize(name); end
end
-class Regexp::Syntax::NotImplementedError < ::SyntaxError
+class Regexp::Syntax::NotImplementedError < ::Regexp::Syntax::SyntaxError
def initialize(syntax, type, token); end
end
@@ -1423,7 +1425,7 @@ Regexp::Syntax::Token::UnicodeProperty::V2_6_2 = T.let(T.unsafe(nil), Array)
Regexp::Syntax::Token::UnicodeProperty::V2_6_3 = T.let(T.unsafe(nil), Array)
-class Regexp::Syntax::UnknownSyntaxNameError < ::SyntaxError
+class Regexp::Syntax::UnknownSyntaxNameError < ::Regexp::Syntax::SyntaxError
def initialize(name); end
end
| true |
Other | Homebrew | brew | 59360930d32fb66fb5de4f135e793deb97495566.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.7.0.rbi | @@ -126,12 +126,10 @@ class RuboCop::CLI::Command::SuggestExtensions < ::RuboCop::CLI::Command::Base
def current_formatter; end
def dependent_gems; end
def extensions; end
+ def installed_gems; end
+ def lockfile; end
def puts(*args); end
def skip?; end
-
- class << self
- def dependent_gems; end
- end
end
RuboCop::CLI::Command::SuggestExtensions::INCLUDED_FORMATTERS = T.let(T.unsafe(nil), Array)
@@ -243,6 +241,7 @@ class RuboCop::Config
def check; end
def delete(*args, &block); end
def deprecation_check; end
+ def dig(*args, &block); end
def disabled_new_cops?; end
def each(*args, &block); end
def each_key(*args, &block); end
@@ -267,6 +266,7 @@ class RuboCop::Config
def patterns_to_include; end
def pending_cops; end
def possibly_include_hidden?; end
+ def replace(*args, &block); end
def signature; end
def smart_loaded_path; end
def target_rails_version; end
@@ -310,6 +310,7 @@ class RuboCop::ConfigLoader
class << self
def add_excludes_from_files(config, config_file); end
+ def add_loaded_features(loaded_features); end
def add_missing_namespaces(path, hash); end
def clear_options; end
def configuration_file_for(target_dir); end
@@ -339,7 +340,6 @@ class RuboCop::ConfigLoader
private
- def add_loaded_features(loaded_features); end
def check_duplication(yaml_code, absolute_path); end
def expand_path(path); end
def file_path(file); end
@@ -366,6 +366,7 @@ class RuboCop::ConfigLoaderResolver
def merge(base_hash, derived_hash, **opts); end
def merge_with_default(config, config_file, unset_nil:); end
def override_department_setting_for_cops(base_hash, derived_hash); end
+ def override_enabled_for_disabled_departments(base_hash, derived_hash); end
def resolve_inheritance(path, hash, file, debug); end
def resolve_inheritance_from_gems(hash); end
def resolve_requires(path, hash); end
@@ -392,34 +393,139 @@ end
class RuboCop::ConfigObsoletion
def initialize(config); end
- def reject_obsolete_cops_and_parameters; end
+ def reject_obsolete!; end
+ def rules; end
def warnings; end
private
- def obsolete_cops; end
- def obsolete_enforced_style; end
- def obsolete_enforced_style_message(cop, param, enforced_style, alternative); end
- def obsolete_parameter_message(cops, parameters, alternative); end
- def obsolete_parameters; end
- def smart_loaded_path; end
+ def load_cop_rules(rules); end
+ def load_parameter_rules(rules); end
+ def load_rules; end
+ def obsoletions; end
+
+ class << self
+ def files; end
+ def files=(_arg0); end
+ def legacy_cop_names; end
+ end
+end
+
+RuboCop::ConfigObsoletion::COP_RULE_CLASSES = T.let(T.unsafe(nil), Hash)
+
+class RuboCop::ConfigObsoletion::ChangedEnforcedStyles < ::RuboCop::ConfigObsoletion::ParameterRule
+ def message; end
+ def violated?; end
+
+ private
+
+ def value; end
+end
+
+RuboCop::ConfigObsoletion::ChangedEnforcedStyles::BASE_MESSAGE = T.let(T.unsafe(nil), String)
+
+class RuboCop::ConfigObsoletion::ChangedParameter < ::RuboCop::ConfigObsoletion::ParameterRule
+ def message; end
+end
+
+RuboCop::ConfigObsoletion::ChangedParameter::BASE_MESSAGE = T.let(T.unsafe(nil), String)
+
+class RuboCop::ConfigObsoletion::CopRule < ::RuboCop::ConfigObsoletion::Rule
+ def initialize(config, old_name); end
+
+ def cop_rule?; end
+ def message; end
+ def old_name; end
+ def violated?; end
+ def warning?; end
end
-RuboCop::ConfigObsoletion::MOVED_COPS = T.let(T.unsafe(nil), Array)
+RuboCop::ConfigObsoletion::DEFAULT_RULES_FILE = T.let(T.unsafe(nil), String)
-RuboCop::ConfigObsoletion::OBSOLETE_COPS = T.let(T.unsafe(nil), Hash)
+class RuboCop::ConfigObsoletion::ExtractedCop < ::RuboCop::ConfigObsoletion::CopRule
+ def initialize(config, old_name, gem); end
-RuboCop::ConfigObsoletion::OBSOLETE_ENFORCED_STYLES = T.let(T.unsafe(nil), Array)
+ def department; end
+ def gem; end
+ def rule_message; end
+ def violated?; end
-RuboCop::ConfigObsoletion::OBSOLETE_PARAMETERS = T.let(T.unsafe(nil), Array)
+ private
-RuboCop::ConfigObsoletion::REMOVED_COPS = T.let(T.unsafe(nil), Array)
+ def affected_cops; end
+ def feature_loaded?; end
+end
-RuboCop::ConfigObsoletion::REMOVED_COPS_WITH_REASON = T.let(T.unsafe(nil), Array)
+RuboCop::ConfigObsoletion::PARAMETER_RULE_CLASSES = T.let(T.unsafe(nil), Hash)
-RuboCop::ConfigObsoletion::RENAMED_COPS = T.let(T.unsafe(nil), Array)
+class RuboCop::ConfigObsoletion::ParameterRule < ::RuboCop::ConfigObsoletion::Rule
+ def initialize(config, cop, parameter, metadata); end
-RuboCop::ConfigObsoletion::SPLIT_COPS = T.let(T.unsafe(nil), Array)
+ def cop; end
+ def metadata; end
+ def parameter; end
+ def parameter_rule?; end
+ def violated?; end
+ def warning?; end
+
+ private
+
+ def alternative; end
+ def reason; end
+ def severity; end
+end
+
+class RuboCop::ConfigObsoletion::RemovedCop < ::RuboCop::ConfigObsoletion::CopRule
+ def initialize(config, old_name, metadata); end
+
+ def metadata; end
+ def old_name; end
+ def rule_message; end
+
+ private
+
+ def alternatives; end
+ def reason; end
+end
+
+RuboCop::ConfigObsoletion::RemovedCop::BASE_MESSAGE = T.let(T.unsafe(nil), String)
+
+class RuboCop::ConfigObsoletion::RenamedCop < ::RuboCop::ConfigObsoletion::CopRule
+ def initialize(config, old_name, new_name); end
+
+ def new_name; end
+ def rule_message; end
+
+ private
+
+ def moved?; end
+ def verb; end
+end
+
+class RuboCop::ConfigObsoletion::Rule
+ def initialize(config); end
+
+ def cop_rule?; end
+ def parameter_rule?; end
+ def violated?; end
+
+ private
+
+ def config; end
+ def smart_loaded_path; end
+ def to_sentence(collection, connector: T.unsafe(nil)); end
+end
+
+class RuboCop::ConfigObsoletion::SplitCop < ::RuboCop::ConfigObsoletion::CopRule
+ def initialize(config, old_name, metadata); end
+
+ def metadata; end
+ def rule_message; end
+
+ private
+
+ def alternatives; end
+end
class RuboCop::ConfigRegeneration
def options; end
@@ -642,7 +748,6 @@ class RuboCop::Cop::Base
def callback_argument(range); end
def complete_investigation; end
def correct(range); end
- def correction_strategy; end
def current_offense_locations; end
def currently_disabled_lines; end
def custom_severity; end
@@ -654,6 +759,7 @@ class RuboCop::Cop::Base
def find_severity(_range, severity); end
def range_from_node_or_range(node_or_range); end
def reset_investigation; end
+ def use_corrector(range, corrector); end
class << self
def autocorrect_incompatible_with; end
@@ -908,6 +1014,7 @@ class RuboCop::Cop::Commissioner
def on_ivar(node); end
def on_ivasgn(node); end
def on_kwarg(node); end
+ def on_kwargs(node); end
def on_kwbegin(node); end
def on_kwnilarg(node); end
def on_kwoptarg(node); end
@@ -921,6 +1028,8 @@ class RuboCop::Cop::Commissioner
def on_match_as(node); end
def on_match_current_line(node); end
def on_match_nil_pattern(node); end
+ def on_match_pattern(node); end
+ def on_match_pattern_p(node); end
def on_match_rest(node); end
def on_match_var(node); end
def on_match_with_lvasgn(node); end
@@ -1246,6 +1355,10 @@ module RuboCop::Cop::EnforceSuperclass
def on_class(node); end
def on_send(node); end
+ private
+
+ def register_offense(offense_node); end
+
class << self
def included(base); end
end
@@ -2112,6 +2225,7 @@ class RuboCop::Cop::Layout::EmptyLineBetweenDefs < ::RuboCop::Cop::Base
def class_candidate?(node); end
def def_end(node); end
def def_start(node); end
+ def end_loc(node); end
def lines_between_defs(first_def_node, second_def_node); end
def maximum_empty_lines; end
def message(node); end
@@ -2595,10 +2709,12 @@ class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop::
def add_correct_closing_paren(node, corrector); end
def add_correct_external_trailing_comma(node, corrector); end
def autocorrect(corrector, node); end
+ def exist_argument_between_heredoc_end_and_closing_parentheses?(node); end
def external_trailing_comma?(node); end
def external_trailing_comma_offset_from_loc_end(node); end
def extract_heredoc(node); end
def extract_heredoc_argument(node); end
+ def find_most_bottom_of_heredoc_end(arguments); end
def fix_closing_parenthesis(node, corrector); end
def fix_external_trailing_comma(node, corrector); end
def heredoc_node?(node); end
@@ -2614,6 +2730,7 @@ class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop::
def send_missing_closing_parens?(parent, child, heredoc); end
def single_line_send_with_heredoc_receiver?(node); end
def space?(pos); end
+ def subsequent_closing_parentheses_in_same_line?(outermost_send); end
class << self
def autocorrect_incompatible_with; end
@@ -2793,20 +2910,19 @@ end
RuboCop::Cop::Layout::LeadingEmptyLines::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base
include(::RuboCop::Cop::CheckLineBreakable)
include(::RuboCop::Cop::ConfigurableMax)
include(::RuboCop::Cop::IgnoredPattern)
include(::RuboCop::Cop::RangeHelp)
include(::RuboCop::Cop::LineLengthHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(range); end
- def correctable?; end
- def investigate(processed_source); end
- def investigate_post_walk(processed_source); end
def on_array(node); end
def on_block(node); end
def on_hash(node); end
+ def on_investigation_end; end
+ def on_new_investigation; end
def on_potential_breakable_node(node); end
def on_send(node); end
@@ -2983,7 +3099,7 @@ class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Cop
def align_with_base_message(rhs); end
def alignment_base(node, rhs, given_style); end
def base_source; end
- def extra_indentation(given_style); end
+ def extra_indentation(given_style, parent); end
def message(node, lhs, rhs); end
def no_base_message(lhs, rhs, node); end
def offending_range(node, lhs, rhs, given_style); end
@@ -3350,6 +3466,21 @@ RuboCop::Cop::Layout::SpaceBeforeBlockBraces::DETECTED_MSG = T.let(T.unsafe(nil)
RuboCop::Cop::Layout::SpaceBeforeBlockBraces::MISSING_MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Layout::SpaceBeforeBrackets < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def on_send(node); end
+
+ private
+
+ def offense_range(node, first_argument, begin_pos); end
+ def register_offense(range); end
+ def space_before_brackets?(node, first_argument); end
+end
+
+RuboCop::Cop::Layout::SpaceBeforeBrackets::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Layout::SpaceBeforeComma < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
include(::RuboCop::Cop::SpaceBeforePunctuation)
@@ -3481,7 +3612,7 @@ class RuboCop::Cop::Layout::SpaceInsideBlockBraces < ::RuboCop::Cop::Base
def multiline_block?(left_brace, right_brace); end
def no_space(begin_pos, end_pos, msg); end
def no_space_inside_left_brace(left_brace, args_delimiter); end
- def offense(begin_pos, end_pos, msg); end
+ def offense(begin_pos, end_pos, msg, style_param = T.unsafe(nil)); end
def pipe?(args_delimiter); end
def space(begin_pos, end_pos, msg); end
def space_inside_left_brace(left_brace, args_delimiter); end
@@ -3705,6 +3836,27 @@ end
module RuboCop::Cop::Lint
end
+class RuboCop::Cop::Lint::AmbiguousAssignment < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+
+ def on_asgn(node); end
+ def on_casgn(node); end
+ def on_cvasgn(node); end
+ def on_gvasgn(node); end
+ def on_ivasgn(node); end
+ def on_lvasgn(node); end
+
+ private
+
+ def rhs(node); end
+end
+
+RuboCop::Cop::Lint::AmbiguousAssignment::MISTAKES = T.let(T.unsafe(nil), Hash)
+
+RuboCop::Cop::Lint::AmbiguousAssignment::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Lint::AmbiguousBlockAssociation < ::RuboCop::Cop::Base
def on_csend(node); end
def on_send(node); end
@@ -3789,7 +3941,7 @@ class RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands < ::RuboCop::Cop::
def on_send(node); end
end
-RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MATH_OPERATORS = T.let(T.unsafe(nil), Set)
+RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::ALLOWED_MATH_OPERATORS = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(nil), String)
@@ -3936,6 +4088,12 @@ class RuboCop::Cop::Lint::DuplicateBranch < ::RuboCop::Cop::Base
private
+ def branches(node); end
+ def consider_branch?(branch); end
+ def const_branch?(branch); end
+ def ignore_constant_branches?; end
+ def ignore_literal_branches?; end
+ def literal_branch?(branch); end
def offense_range(duplicate_branch); end
end
@@ -4818,6 +4976,7 @@ class RuboCop::Cop::Lint::RedundantSplatExpansion < ::RuboCop::Cop::Base
private
+ def allow_percent_literal_array_argument?; end
def array_new_inside_array_literal?(array_new_node); end
def array_splat?(node); end
def autocorrect(corrector, node); end
@@ -4827,6 +4986,7 @@ class RuboCop::Cop::Lint::RedundantSplatExpansion < ::RuboCop::Cop::Base
def redundant_splat_expansion(node); end
def remove_brackets(array); end
def replacement_range_and_content(node); end
+ def use_percent_literal_array_argument?(node); end
end
RuboCop::Cop::Lint::RedundantSplatExpansion::ARRAY_PARAM_MSG = T.let(T.unsafe(nil), String)
@@ -5083,7 +5243,6 @@ class RuboCop::Cop::Lint::ShadowedException < ::RuboCop::Cop::Base
def offense_range(rescues); end
def rescued_exceptions(rescue_group); end
def rescued_groups_for(rescues); end
- def silence_warnings; end
def sorted?(rescued_groups); end
def system_call_err?(error); end
end
@@ -5092,6 +5251,7 @@ RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Lint::ShadowingOuterLocalVariable < ::RuboCop::Cop::Base
def before_declaring_variable(variable, variable_table); end
+ def ractor_block?(param0 = T.unsafe(nil)); end
class << self
def joining_forces; end
@@ -5259,6 +5419,8 @@ end
RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::IgnoredPattern)
+
def break_command?(param0 = T.unsafe(nil)); end
def on_block(node); end
def on_for(node); end
@@ -6120,18 +6282,22 @@ class RuboCop::Cop::Naming::MemoizedInstanceVariableName < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
def defined_memoized?(param0 = T.unsafe(nil), param1); end
+ def method_definition?(param0 = T.unsafe(nil)); end
def on_defined?(node); end
def on_or_asgn(node); end
private
+ def find_definition(node); end
def matches?(method_name, ivar_assign); end
def message(variable); end
def style_parameter_name; end
def suggested_var(method_name); end
def variable_name_candidates(method_name); end
end
+RuboCop::Cop::Naming::MemoizedInstanceVariableName::DYNAMIC_DEFINE_METHODS = T.let(T.unsafe(nil), Set)
+
RuboCop::Cop::Naming::MemoizedInstanceVariableName::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Naming::MemoizedInstanceVariableName::UNDERSCORE_REQUIRED = T.let(T.unsafe(nil), String)
@@ -6499,6 +6665,7 @@ class RuboCop::Cop::Registry
def enabled_pending_cop?(cop_cfg, config); end
def enlist(cop); end
def find_by_cop_name(cop_name); end
+ def freeze; end
def length; end
def names; end
def options; end
@@ -6524,6 +6691,7 @@ class RuboCop::Cop::Registry
def all; end
def global; end
def qualified_cop_name(name, origin); end
+ def reset!; end
def with_temporary_global(temp_global = T.unsafe(nil)); end
end
end
@@ -6708,7 +6876,7 @@ class RuboCop::Cop::StringLiteralCorrector
extend(::RuboCop::Cop::Util)
class << self
- def correct(node, style); end
+ def correct(corrector, node, style); end
end
end
@@ -7116,10 +7284,11 @@ end
RuboCop::Cop::Style::CaseLikeIf::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Style::CharacterLiteral < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Style::CharacterLiteral < ::RuboCop::Cop::Base
include(::RuboCop::Cop::StringHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
+ def autocorrect(corrector, node); end
def correct_style_detected; end
def offense?(node); end
def opposite_style_detected; end
@@ -7266,7 +7435,9 @@ class RuboCop::Cop::Style::CollectionMethods < ::RuboCop::Cop::Base
private
def check_method_node(node); end
+ def implicit_block?(node); end
def message(node); end
+ def methods_accepting_symbol; end
end
RuboCop::Cop::Style::CollectionMethods::MSG = T.let(T.unsafe(nil), String)
@@ -7354,12 +7525,16 @@ RuboCop::Cop::Style::CommentAnnotation::MISSING_NOTE = T.let(T.unsafe(nil), Stri
RuboCop::Cop::Style::CommentAnnotation::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::CommentedKeyword < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+
def on_new_investigation; end
private
def line(comment); end
def offensive?(comment); end
+ def register_offense(comment, matched_keyword); end
end
RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENTS = T.let(T.unsafe(nil), Array)
@@ -7940,6 +8115,7 @@ RuboCop::Cop::Style::ExponentialNotation::MESSAGES = T.let(T.unsafe(nil), Hash)
class RuboCop::Cop::Style::FloatDivision < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
+ extend(::RuboCop::Cop::AutoCorrector)
def any_coerce?(param0 = T.unsafe(nil)); end
def both_coerce?(param0 = T.unsafe(nil)); end
@@ -7949,8 +8125,12 @@ class RuboCop::Cop::Style::FloatDivision < ::RuboCop::Cop::Base
private
+ def add_to_f_method(corrector, node); end
+ def correct_from_slash_to_fdiv(corrector, node, receiver, argument); end
+ def extract_receiver_source(node); end
def message(_node); end
def offense_condition?(node); end
+ def remove_to_f_method(corrector, send_node); end
end
RuboCop::Cop::Style::FloatDivision::MESSAGES = T.let(T.unsafe(nil), Hash)
@@ -8140,6 +8320,26 @@ end
RuboCop::Cop::Style::HashEachMethods::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Style::HashExcept < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::TargetRubyVersion)
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def bad_method?(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+
+ private
+
+ def except_key(node); end
+ def offense_range(node); end
+ def safe_to_register_offense?(block, except_key); end
+ def semantically_except_method?(send, block); end
+end
+
+RuboCop::Cop::Style::HashExcept::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Style::HashExcept::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Style::HashLikeCase < ::RuboCop::Cop::Base
def hash_like_case?(param0 = T.unsafe(nil)); end
def on_case(node); end
@@ -8286,6 +8486,10 @@ class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base
def too_long_line_based_on_config?(range, line); end
def too_long_line_based_on_ignore_cop_directives?(range, line); end
def too_long_single_line?(node); end
+
+ class << self
+ def autocorrect_incompatible_with; end
+ end
end
RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_MODIFIER = T.let(T.unsafe(nil), String)
@@ -8405,7 +8609,7 @@ RuboCop::Cop::Style::InverseMethods::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::InverseMethods::NEGATED_EQUALITY_METHODS = T.let(T.unsafe(nil), Array)
-class RuboCop::Cop::Style::IpAddresses < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Style::IpAddresses < ::RuboCop::Cop::Base
include(::RuboCop::Cop::StringHelp)
def correct_style_detected; end
@@ -8545,6 +8749,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
def allowed_multiline_call_with_parentheses?(node); end
def ambigious_literal?(node); end
def assigned_before?(node, target); end
+ def auto_correct(corrector, node); end
def call_as_argument_or_chain?(node); end
def call_in_literals?(node); end
def call_in_logical_operators?(node); end
@@ -8554,6 +8759,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
def call_with_braced_block?(node); end
def hash_literal?(node); end
def hash_literal_in_arguments?(node); end
+ def inside_endless_method_def?(node); end
def legitimate_call_with_parentheses?(node); end
def logical_operator?(node); end
def offense_range(node); end
@@ -8802,11 +9008,16 @@ RuboCop::Cop::Style::MultilineMemoization::BRACES_MSG = T.let(T.unsafe(nil), Str
RuboCop::Cop::Style::MultilineMemoization::KEYWORD_MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::MultilineMethodSignature < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+
def on_def(node); end
def on_defs(node); end
private
+ def arguments_range(node); end
+ def autocorrect(corrector, node); end
def closing_line(node); end
def correction_exceeds_max_line_length?(node); end
def definition_width(node); end
@@ -8882,6 +9093,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
def autocorrect(corrector, node); end
def check(value); end
def correct_splat_expansion(corrector, expr, splat_value); end
+ def frozen_regexp_or_range_literals?(node); end
def frozen_string_literal?(node); end
def immutable_literal?(node); end
def mutable_literal?(value); end
@@ -9437,10 +9649,20 @@ RuboCop::Cop::Style::PercentQLiterals::UPPER_CASE_Q_MSG = T.let(T.unsafe(nil), S
class RuboCop::Cop::Style::PerlBackrefs < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
+ def on_back_ref(node); end
+ def on_gvar(node); end
def on_nth_ref(node); end
+
+ private
+
+ def derived_from_braceless_interpolation?(node); end
+ def format_message(node:, preferred_expression:); end
+ def on_back_ref_or_gvar_or_nth_ref(node); end
+ def original_expression_of(node); end
+ def preferred_expression_to(node); end
end
-RuboCop::Cop::Style::PerlBackrefs::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Style::PerlBackrefs::MESSAGE_FORMAT = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::PreferredHashMethods < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
@@ -9519,10 +9741,14 @@ RuboCop::Cop::Style::RandomWithOffset::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::RandomWithOffset::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Style::RedundantArgument < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+
def on_send(node); end
private
+ def argument_range(node); end
def redundant_arg_for_method(method_name); end
def redundant_argument?(node); end
end
@@ -10217,14 +10443,17 @@ RuboCop::Cop::Style::SingleArgumentDig::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::SingleArgumentDig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Style::SingleLineBlockParams < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::AutoCorrector)
+
def on_block(node); end
private
def args_match?(method_name, args); end
+ def autocorrect(corrector, node, preferred_block_arguments, joined_block_arguments); end
+ def build_preferred_arguments_map(node, preferred_arguments); end
def eligible_arguments?(node); end
def eligible_method?(node); end
- def message(node); end
def method_name(method); end
def method_names; end
def methods; end
@@ -10274,8 +10503,10 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
def autocorrect(corrector, node, if_branch); end
def correct_for_basic_condition_style(corrector, node, if_branch, and_operator); end
def correct_for_comment(corrector, node, if_branch); end
- def correct_for_gurad_condition_style(corrector, node, if_branch, and_operator); end
+ def correct_for_guard_condition_style(corrector, node, if_branch, and_operator); end
def offending_branch?(branch); end
+ def replacement_condition(and_operator, condition); end
+ def wrap_condition?(node); end
end
RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String)
@@ -10376,6 +10607,8 @@ class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base
def collect_parts(node, parts); end
def corrected_ancestor?(node); end
def find_topmost_plus_node(node); end
+ def handle_quotes(parts); end
+ def line_end_concatenation?(node); end
def plus_node?(node); end
def replacement(parts); end
def single_quoted?(str_node); end
@@ -10396,35 +10629,38 @@ end
RuboCop::Cop::Style::StringHashKeys::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Style::StringLiterals < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Style::StringLiterals < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::StringHelp)
include(::RuboCop::Cop::StringLiteralsHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_dstr(node); end
private
def accept_child_double_quotes?(nodes); end
def all_string_literals?(nodes); end
+ def autocorrect(corrector, node); end
def check_multiline_quote_style(node, quote); end
def consistent_multiline?; end
def detect_quote_styles(node); end
def message(_node); end
def offense?(node); end
+ def register_offense(node, message: T.unsafe(nil)); end
def unexpected_double_quotes?(quote); end
def unexpected_single_quotes?(quote); end
end
RuboCop::Cop::Style::StringLiterals::MSG_INCONSISTENT = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Style::StringLiteralsInInterpolation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Style::StringLiteralsInInterpolation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::StringHelp)
include(::RuboCop::Cop::StringLiteralsHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
+ def autocorrect(corrector, node); end
private
@@ -10540,6 +10776,7 @@ class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base
def on_numblock(node); end
def proc_node?(param0 = T.unsafe(nil)); end
def symbol_proc?(param0 = T.unsafe(nil)); end
+ def symbol_proc_receiver?(param0 = T.unsafe(nil)); end
private
@@ -11978,6 +12215,16 @@ end
class RuboCop::IncorrectCopNameError < ::StandardError
end
+class RuboCop::Lockfile
+ def dependencies; end
+ def gems; end
+ def includes_gem?(name); end
+
+ private
+
+ def parser; end
+end
+
class RuboCop::MagicComment
def initialize(comment); end
@@ -12082,6 +12329,7 @@ class RuboCop::Options
def define_options; end
def long_opt_symbol(args); end
def option(opts, *args); end
+ def require_feature(file); end
end
RuboCop::Options::DEFAULT_MAXIMUM_EXCLUSION_ITEMS = T.let(T.unsafe(nil), Integer)
@@ -12256,6 +12504,7 @@ class RuboCop::Runner
def mobilize_team(processed_source); end
def mobilized_cop_classes(config); end
def process_file(file); end
+ def qualify_option_cop_names; end
def redundant_cop_disable_directive(file); end
def save_in_cache(cache, offenses); end
def standby_team(config); end
@@ -12397,6 +12646,12 @@ end
RuboCop::Token = RuboCop::AST::Token
+module RuboCop::Util
+ class << self
+ def silence_warnings; end
+ end
+end
+
class RuboCop::ValidationError < ::RuboCop::Error
end
@@ -12427,13 +12682,3 @@ module RuboCop::YAMLDuplicationChecker
def traverse(tree, &on_duplicated); end
end
end
-
-class String
- include(::Comparable)
- include(::JSON::Ext::Generator::GeneratorMethods::String)
- include(::Colorize::InstanceMethods)
- extend(::JSON::Ext::Generator::GeneratorMethods::String::Extend)
- extend(::Colorize::ClassMethods)
-
- def blank?; end
-end | true |
Other | Homebrew | brew | 59360930d32fb66fb5de4f135e793deb97495566.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -5873,8 +5873,6 @@ module CopHelper
def inspect_source(source, file=T.unsafe(nil)); end
- def inspect_source_file(source); end
-
def parse_source(source, file=T.unsafe(nil)); end
end
@@ -27709,6 +27707,12 @@ class RuboCop::AST::Node
def key_node(param0=T.unsafe(nil)); end
+ def kwargs_type?(); end
+
+ def match_pattern_p_type?(); end
+
+ def match_pattern_type?(); end
+
def method_node(param0=T.unsafe(nil)); end
def val_node(param0=T.unsafe(nil)); end
@@ -27724,6 +27728,15 @@ module RuboCop::AST::NodePattern::Sets
SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped)
SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
+ SET___EQL = ::T.let(nil, ::T.untyped)
+end
+
+module RuboCop::AST::Traversal
+ def on_kwargs(node); end
+
+ def on_match_pattern(node); end
+
+ def on_match_pattern_p(node); end
end
class RuboCop::Cask::AST::CaskHeader
@@ -27925,7 +27938,7 @@ class RuboCop::Cop::FormulaCop
end
module RuboCop::RSpec::ExpectOffense
- def expect_correction(correction, loop: T.unsafe(nil)); end
+ def expect_correction(correction, loop: T.unsafe(nil), source: T.unsafe(nil)); end
def expect_no_corrections(); end
@@ -27934,6 +27947,12 @@ module RuboCop::RSpec::ExpectOffense
def expect_offense(source, file=T.unsafe(nil), severity: T.unsafe(nil), **replacements); end
def format_offense(source, **replacements); end
+
+ def parse_annotations(source, raise_error: T.unsafe(nil), **replacements); end
+
+ def parse_processed_source(source, file=T.unsafe(nil)); end
+
+ def set_formatter_options(); end
end
class RuboCop::RSpec::ExpectOffense::AnnotatedSource | true |
Other | Homebrew | brew | ff2de4ca56f50fa9487d3fb9f09bda9a71169c38.json | Update RBI files for plist. | Library/Homebrew/sorbet/rbi/gems/plist@3.6.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `plist` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
+# Please instead update this file by running `tapioca sync`.
# typed: true
@@ -15,36 +15,35 @@ module Plist::Emit
def to_plist(envelope = T.unsafe(nil), options = T.unsafe(nil)); end
class << self
- def comment(content); end
def dump(obj, envelope = T.unsafe(nil), options = T.unsafe(nil)); end
- def element_type(item); end
- def plist_node(element, options = T.unsafe(nil)); end
def save_plist(obj, filename, options = T.unsafe(nil)); end
- def tag(type, contents = T.unsafe(nil), options = T.unsafe(nil), &block); end
def wrap(contents); end
end
end
Plist::Emit::DEFAULT_INDENT = T.let(T.unsafe(nil), String)
-class Plist::Emit::IndentedString
- def initialize(str = T.unsafe(nil)); end
+class Plist::Emit::PlistBuilder
+ def initialize(indent_str); end
- def <<(val); end
- def indent_string; end
- def indent_string=(_); end
- def lower_indent; end
- def raise_indent; end
- def to_s; end
+ def build(element, level = T.unsafe(nil)); end
+
+ private
+
+ def comment_tag(content); end
+ def data_tag(data, level); end
+ def element_type(item); end
+ def indent(str, level); end
+ def tag(type, contents, level, &block); end
end
class Plist::Listener
def initialize; end
def open; end
- def open=(_); end
+ def open=(_arg0); end
def result; end
- def result=(_); end
+ def result=(_arg0); end
def tag_end(name); end
def tag_start(name, attributes); end
def text(contents); end
@@ -94,9 +93,9 @@ class Plist::PTag
def initialize; end
def children; end
- def children=(_); end
+ def children=(_arg0); end
def text; end
- def text=(_); end
+ def text=(_arg0); end
def to_ruby; end
class << self
@@ -119,6 +118,8 @@ class Plist::StreamParser
def parse_encoding_from_xml_declaration(xml_declaration); end
end
+Plist::StreamParser::CDATA = T.let(T.unsafe(nil), Regexp)
+
Plist::StreamParser::COMMENT_END = T.let(T.unsafe(nil), Regexp)
Plist::StreamParser::COMMENT_START = T.let(T.unsafe(nil), Regexp)
@@ -127,6 +128,11 @@ Plist::StreamParser::DOCTYPE_PATTERN = T.let(T.unsafe(nil), Regexp)
Plist::StreamParser::TEXT = T.let(T.unsafe(nil), Regexp)
+Plist::StreamParser::UNIMPLEMENTED_ERROR = T.let(T.unsafe(nil), String)
+
Plist::StreamParser::XMLDECL_PATTERN = T.let(T.unsafe(nil), Regexp)
+class Plist::UnimplementedElementError < ::RuntimeError
+end
+
Plist::VERSION = T.let(T.unsafe(nil), String) | false |
Other | Homebrew | brew | ac3ce218e3560713c44e856b2906be7e53a164e0.json | man: fix style issue | Library/Homebrew/dev-cmd/man.rb | @@ -218,7 +218,8 @@ def cmd_comment_manpage_lines(cmd_path)
sig { returns(String) }
def global_cask_options_manpage
- lines = ["These options are applicable to the `install`, `reinstall`, and `upgrade` subcommands with the `--cask` flag.\n"]
+ lines = ["These options are applicable to the `install`, `reinstall`, and `upgrade` " \
+ "subcommands with the `--cask` flag.\n"]
lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, description:, **|
generate_option_doc(nil, long.chomp("="), description)
end | false |
Other | Homebrew | brew | 5f7c369bc8b66ee3a107741d4ed8ec9bbea340d4.json | docs: fix wording on manpage for cask options | Library/Homebrew/dev-cmd/man.rb | @@ -218,7 +218,7 @@ def cmd_comment_manpage_lines(cmd_path)
sig { returns(String) }
def global_cask_options_manpage
- lines = ["These options are applicable to subcommands accepting a `--cask` flag and all `cask` commands.\n"]
+ lines = ["These options are applicable to the `install`, `reinstall`, and `upgrade` subcommands with the `--cask` flag.\n"]
lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, description:, **|
generate_option_doc(nil, long.chomp("="), description)
end | true |
Other | Homebrew | brew | 5f7c369bc8b66ee3a107741d4ed8ec9bbea340d4.json | docs: fix wording on manpage for cask options | docs/Manpage.md | @@ -1396,7 +1396,7 @@ Install and commit Homebrew's vendored gems.
## GLOBAL CASK OPTIONS
-These options are applicable to subcommands accepting a `--cask` flag and all `cask` commands.
+These options are applicable to the `install`, `reinstall`, and `upgrade` subcommands with the `--cask` flag.
* `--appdir`:
Target location for Applications (default: `/Applications`). | true |
Other | Homebrew | brew | 5f7c369bc8b66ee3a107741d4ed8ec9bbea340d4.json | docs: fix wording on manpage for cask options | manpages/brew.1 | @@ -1945,7 +1945,7 @@ Install and commit Homebrew\'s vendored gems\.
Update all vendored Gems to the latest version\.
.
.SH "GLOBAL CASK OPTIONS"
-These options are applicable to subcommands accepting a \fB\-\-cask\fR flag and all \fBcask\fR commands\.
+These options are applicable to the \fBinstall\fR, \fBreinstall\fR, and \fBupgrade\fR subcommands with the \fB\-\-cask\fR flag\.
.
.TP
\fB\-\-appdir\fR | true |
Other | Homebrew | brew | c424201401193ae23d24c02c0fb49294fc312c75.json | formula_creator: update hash syntax | Library/Homebrew/formula_creator.rb | @@ -193,15 +193,15 @@ def install
# end
bin.install name
- bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"])
+ bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"])
<% elsif mode == :python %>
virtualenv_install_with_resources
<% elsif mode == :ruby %>
ENV["GEM_HOME"] = libexec
system "gem", "build", "\#{name}.gemspec"
system "gem", "install", "\#{name}-\#{version}.gem"
bin.install libexec/"bin/\#{name}"
- bin.env_script_all_files(libexec/"bin", :GEM_HOME => ENV["GEM_HOME"])
+ bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV["GEM_HOME"])
<% elsif mode == :rust %>
system "cargo", "install", *std_cargo_args
<% else %> | false |
Other | Homebrew | brew | 34a88a3bb083508da3a12a7f1ad744a1d6abf312.json | update: add notice that unshallowing takes time | Library/Homebrew/cmd/update.sh | @@ -392,6 +392,14 @@ EOS
[[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core/.git/shallow" ]] && HOMEBREW_CORE_SHALLOW=1
[[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask/.git/shallow" ]] && HOMEBREW_CASK_SHALLOW=1
+ if [[ -n $HOMEBREW_CORE_SHALLOW && -n $HOMEBREW_CASK_SHALLOW ]]
+ then
+ SHALLOW_COMMAND_PHRASE="These commands"
+ SHALLOW_REPO_PHRASE="repositories"
+ else
+ SHALLOW_COMMAND_PHRASE="This command"
+ SHALLOW_REPO_PHRASE="repository"
+ fi
if [[ -n $HOMEBREW_CORE_SHALLOW || -n $HOMEBREW_CASK_SHALLOW ]]
then
@@ -402,6 +410,7 @@ ${HOMEBREW_CORE_SHALLOW:+
To \`brew update\`, first run:${HOMEBREW_CORE_SHALLOW:+
git -C "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" fetch --unshallow}${HOMEBREW_CASK_SHALLOW:+
git -C "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask" fetch --unshallow}
+${SHALLOW_COMMAND_PHRASE} may take a few minutes to run due to the large size of the ${SHALLOW_REPO_PHRASE}.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you | false |
Other | Homebrew | brew | 28c4dccb0bc7b2e147f8cec770f80f2b8f08501d.json | Update RBI files for sorbet. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -532,6 +532,14 @@ class ActiveSupport::CurrentAttributes
def _reset_callbacks(); end
def _run_reset_callbacks(&block); end
+
+ def attributes(); end
+
+ def attributes=(attributes); end
+
+ def reset(); end
+
+ def set(set_attributes); end
end
class ActiveSupport::CurrentAttributes
@@ -553,9 +561,17 @@ class ActiveSupport::CurrentAttributes
def self.before_reset(&block); end
+ def self.clear_all(); end
+
def self.instance(); end
+ def self.reset(*args, &block); end
+
+ def self.reset_all(); end
+
def self.resets(&block); end
+
+ def self.set(*args, &block); end
end
module ActiveSupport::Dependencies
@@ -6660,8 +6676,6 @@ end
class Errno::EBADRPC
end
-Errno::ECAPMODE = Errno::NOERROR
-
Errno::EDEADLOCK = Errno::NOERROR
class Errno::EDEVERR
@@ -6682,13 +6696,6 @@ end
Errno::EIPSEC = Errno::NOERROR
-class Errno::ELAST
- Errno = ::T.let(nil, ::T.untyped)
-end
-
-class Errno::ELAST
-end
-
class Errno::ENEEDAUTH
Errno = ::T.let(nil, ::T.untyped)
end
@@ -6710,8 +6717,6 @@ end
class Errno::ENOPOLICY
end
-Errno::ENOTCAPABLE = Errno::NOERROR
-
class Errno::ENOTSUP
Errno = ::T.let(nil, ::T.untyped)
end
@@ -6754,7 +6759,12 @@ end
class Errno::EPWROFF
end
-Errno::EQFULL = Errno::ELAST
+class Errno::EQFULL
+ Errno = ::T.let(nil, ::T.untyped)
+end
+
+class Errno::EQFULL
+end
class Errno::ERPCMISMATCH
Errno = ::T.let(nil, ::T.untyped)
@@ -13119,6 +13129,7 @@ class Object
def to_query(key); end
def to_yaml(options=T.unsafe(nil)); end
+ APPLE_GEM_HOME = ::T.let(nil, ::T.untyped)
ARGF = ::T.let(nil, ::T.untyped)
ARGV = ::T.let(nil, ::T.untyped)
BUG_REPORTS_URL = ::T.let(nil, ::T.untyped)
@@ -13183,6 +13194,8 @@ class Object
RUBY_DESCRIPTION = ::T.let(nil, ::T.untyped)
RUBY_ENGINE = ::T.let(nil, ::T.untyped)
RUBY_ENGINE_VERSION = ::T.let(nil, ::T.untyped)
+ RUBY_FRAMEWORK = ::T.let(nil, ::T.untyped)
+ RUBY_FRAMEWORK_VERSION = ::T.let(nil, ::T.untyped)
RUBY_PATCHLEVEL = ::T.let(nil, ::T.untyped)
RUBY_PATH = ::T.let(nil, ::T.untyped)
RUBY_PLATFORM = ::T.let(nil, ::T.untyped)
@@ -13235,11 +13248,7 @@ class OpenSSL::KDF::KDFError
end
module OpenSSL::KDF
- def self.hkdf(*_); end
-
def self.pbkdf2_hmac(*_); end
-
- def self.scrypt(*_); end
end
class OpenSSL::OCSP::Request
@@ -13248,29 +13257,20 @@ end
OpenSSL::PKCS7::Signer = OpenSSL::PKCS7::SignerInfo
-class OpenSSL::PKey::EC
- EXPLICIT_CURVE = ::T.let(nil, ::T.untyped)
-end
-
class OpenSSL::PKey::EC::Point
def to_octet_string(_); end
end
module OpenSSL::SSL
- OP_ALLOW_NO_DHE_KEX = ::T.let(nil, ::T.untyped)
OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = ::T.let(nil, ::T.untyped)
OP_CRYPTOPRO_TLSEXT_BUG = ::T.let(nil, ::T.untyped)
OP_LEGACY_SERVER_CONNECT = ::T.let(nil, ::T.untyped)
- OP_NO_ENCRYPT_THEN_MAC = ::T.let(nil, ::T.untyped)
- OP_NO_RENEGOTIATION = ::T.let(nil, ::T.untyped)
- OP_NO_TLSv1_3 = ::T.let(nil, ::T.untyped)
OP_SAFARI_ECDHE_ECDSA_BUG = ::T.let(nil, ::T.untyped)
OP_TLSEXT_PADDING = ::T.let(nil, ::T.untyped)
SSL2_VERSION = ::T.let(nil, ::T.untyped)
SSL3_VERSION = ::T.let(nil, ::T.untyped)
TLS1_1_VERSION = ::T.let(nil, ::T.untyped)
TLS1_2_VERSION = ::T.let(nil, ::T.untyped)
- TLS1_3_VERSION = ::T.let(nil, ::T.untyped)
TLS1_VERSION = ::T.let(nil, ::T.untyped)
end
@@ -29818,6 +29818,7 @@ class Socket
IPV6_PATHMTU = ::T.let(nil, ::T.untyped)
IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped)
IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped)
+ IP_DONTFRAG = ::T.let(nil, ::T.untyped)
IP_PORTRANGE = ::T.let(nil, ::T.untyped)
IP_RECVDSTADDR = ::T.let(nil, ::T.untyped)
IP_RECVIF = ::T.let(nil, ::T.untyped)
@@ -29909,6 +29910,7 @@ module Socket::Constants
IPV6_PATHMTU = ::T.let(nil, ::T.untyped)
IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped)
IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped)
+ IP_DONTFRAG = ::T.let(nil, ::T.untyped)
IP_PORTRANGE = ::T.let(nil, ::T.untyped)
IP_RECVDSTADDR = ::T.let(nil, ::T.untyped)
IP_RECVIF = ::T.let(nil, ::T.untyped) | false |
Other | Homebrew | brew | a33f4e0fd1faf60289903cacc89f649739c1b849.json | release-notes: show warning on recent major/minor tag | Library/Homebrew/dev-cmd/release-notes.rb | @@ -17,6 +17,10 @@ def release_notes_args
Print the merged pull requests on Homebrew/brew between two Git refs.
If no <previous_tag> is provided it defaults to the latest tag.
If no <end_ref> is provided it defaults to `origin/master`.
+
+ If `--markdown` and a <previous_tag> are passed, an extra line containg
+ a link to the Homebrew blog will be adding to the output. Additionally,
+ a warning will be shown if the latest minor release was less than one month ago.
EOS
switch "--markdown",
description: "Print as a Markdown list."
@@ -29,6 +33,15 @@ def release_notes
args = release_notes_args.parse
previous_tag = args.named.first
+
+ if previous_tag.present?
+
+ previous_tag_date = Date.parse Utils.popen_read(
+ "git", "-C", HOMEBREW_REPOSITORY, "log", "-1", "--format=%aI", previous_tag.sub(/\d+$/, "0")
+ )
+ opoo "The latest major/minor release was less than one month ago." if previous_tag_date > (Date.today << 1)
+ end
+
previous_tag ||= Utils.popen_read(
"git", "-C", HOMEBREW_REPOSITORY, "tag", "--list", "--sort=-version:refname"
).lines.first.chomp | true |
Other | Homebrew | brew | a33f4e0fd1faf60289903cacc89f649739c1b849.json | release-notes: show warning on recent major/minor tag | docs/Manpage.md | @@ -1197,6 +1197,10 @@ Print the merged pull requests on Homebrew/brew between two Git refs.
If no *`previous_tag`* is provided it defaults to the latest tag.
If no *`end_ref`* is provided it defaults to `origin/master`.
+If `--markdown` and a *`previous_tag`* are passed, an extra line containg
+a link to the Homebrew blog will be adding to the output. Additionally,
+a warning will be shown if the latest minor release was less than one month ago.
+
* `--markdown`:
Print as a Markdown list.
| true |
Other | Homebrew | brew | a33f4e0fd1faf60289903cacc89f649739c1b849.json | release-notes: show warning on recent major/minor tag | manpages/brew.1 | @@ -1672,6 +1672,9 @@ Use \fBstackprof\fR instead of \fBruby\-prof\fR (the default)\.
.SS "\fBrelease\-notes\fR [\fIoptions\fR] [\fIprevious_tag\fR] [\fIend_ref\fR]"
Print the merged pull requests on Homebrew/brew between two Git refs\. If no \fIprevious_tag\fR is provided it defaults to the latest tag\. If no \fIend_ref\fR is provided it defaults to \fBorigin/master\fR\.
.
+.P
+If \fB\-\-markdown\fR and a \fIprevious_tag\fR are passed, an extra line containg a link to the Homebrew blog will be adding to the output\. Additionally, a warning will be shown if the latest minor release was less than one month ago\.
+.
.TP
\fB\-\-markdown\fR
Print as a Markdown list\. | true |
Other | Homebrew | brew | 5784e36ead31f94e46b102323d05ef20b841a0f5.json | docs: improve clarity in deprecate/disable/removal docs
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Michka Popoff <3406519+iMichka@users.noreply.github.com>
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | docs/Deprecating-Disabling-and-Removing-Formulae.md | @@ -12,9 +12,9 @@ This general rule of thumb can be followed:
## Deprecation
-If a user attempts to install a deprecated formula, they will be shown a warning message but the install will succeed.
+If a user attempts to install a deprecated formula, they will be shown a warning message but the install will proceed.
-A formula should be deprecated to indicate to users that the formula should not be used and may be disabled in the future. Deprecated formulae should still build from source and their bottles should continue to work.
+A formula should be deprecated to indicate to users that the formula should not be used and may be disabled in the future. Deprecated formulae should still build from source and their bottles should continue to work. These formulae should continue to receive maintenance as needed to allow them to build.
The most common reasons for deprecation are when the upstream project is deprecated, unmaintained, or archived.
@@ -55,15 +55,13 @@ The `because` parameter can be a preset reason (using a symbol) or a custom reas
## Removal
-A formula should be removed if it does not meet our criteria for [acceptable formulae](Acceptable-Formulae.md) or [versioned formulae](Versions.md), has a non-open-source license, or has been disabled for a long period of time.
-
-**Note: disabled formulae in homebrew/core will be automatically removed one year after their disable date**
+A formula should be removed if it does not meet our criteria for [acceptable formulae](Acceptable-Formulae.md) or [versioned formulae](Versions.md), has a non-open-source license, or has been disabled for over a year.
## Deprecate and Disable Reasons
When a formula is deprecated or disabled, a reason explaining the action must be provided.
-There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are listed below and can be found in the [`DeprecateDisable` module](https://rubydoc.brew.sh/DeprecateDisable.html#DEPRECATE_DISABLE_REASONS-constant):
+There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are listed below and can be found in the [`DeprecateDisable` module](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/deprecate_disable.rb):
- `:does_not_build`: the formula cannot be built from source
- `:no_license`: the formula does not have a license | false |
Other | Homebrew | brew | 1b4993c9ce9c1ba7966819298336c56f6f3b8861.json | cmd/install: add comment to deprecate --env.
We don't allow this on upgrade or reinstall so let's make `StdEnv`
essentially a private, internal API. | Library/Homebrew/cmd/install.rb | @@ -131,6 +131,11 @@ def install_args
def install
args = install_args.parse
+ if args.env.present?
+ # TODO: enable for Homebrew 2.8.0 and use `replacement: false` for 2.9.0.
+ # odeprecated "brew install --env", "`env :std` in specific formula files"
+ end
+
args.named.each do |name|
next if File.exist?(name)
next if name !~ HOMEBREW_TAP_FORMULA_REGEX && name !~ HOMEBREW_CASK_TAP_CASK_REGEX | false |
Other | Homebrew | brew | 4c1b2630dcf99793e8ecfed60c441dd080418401.json | Fix sorbet errors. | Library/Homebrew/cache_store.rb | @@ -38,6 +38,15 @@ def self.use(type)
return_value
end
+ # Creates a CacheStoreDatabase.
+ #
+ # @param [Symbol] type
+ # @return [nil]
+ def initialize(type)
+ @type = type
+ @dirty = false
+ end
+
# Sets a value in the underlying database (and creates it if necessary).
def set(key, value)
dirty!
@@ -120,15 +129,6 @@ def db
@db ||= {}
end
- # Creates a CacheStoreDatabase.
- #
- # @param [Symbol] type
- # @return [nil]
- def initialize(type)
- @type = type
- @dirty = false
- end
-
# The path where the database resides in the `HOMEBREW_CACHE` for the given
# `@type`.
# | true |
Other | Homebrew | brew | 4c1b2630dcf99793e8ecfed60c441dd080418401.json | Fix sorbet errors. | Library/Homebrew/utils/spdx.rb | @@ -39,8 +39,8 @@ def download_latest_license_data!(to: DATA_PATH)
end
def parse_license_expression(license_expression)
- licenses = []
- exceptions = []
+ licenses = T.let([], T::Array[T.any(String, Symbol)])
+ exceptions = T.let([], T::Array[String])
case license_expression
when String, Symbol | true |
Other | Homebrew | brew | b6447120aed42a58a70aad54e7c997ae7f22e685.json | mktemp: avoid directories with @ | Library/Homebrew/mktemp.rb | @@ -40,7 +40,7 @@ def to_s
end
def run
- @tmpdir = Pathname.new(Dir.mktmpdir("#{@prefix}-", HOMEBREW_TEMP))
+ @tmpdir = Pathname.new(Dir.mktmpdir("#{@prefix.tr "@", "-"}-", HOMEBREW_TEMP))
# Make sure files inside the temporary directory have the same group as the
# brew instance. | false |
Other | Homebrew | brew | d345864d7e6f98488ed6fc454c0338bb20b751b2.json | exceptions: fix ErrorDuringExecution status.
This can sometimes be nil so handle that.
Fixes #10158 | Library/Homebrew/exceptions.rb | @@ -582,7 +582,7 @@ def initialize(cmd, status:, output: nil, secrets: [])
when Integer
status
else
- status.exitstatus
+ status&.exitstatus
end
redacted_cmd = redact_secrets(cmd.shelljoin.gsub('\=', "="), secrets)
@@ -592,7 +592,7 @@ def initialize(cmd, status:, output: nil, secrets: [])
elsif (uncaught_signal = status.termsig)
"was terminated by uncaught signal #{Signal.signame(uncaught_signal)}"
else
- raise ArgumentError, "Status does neither have `exitstatus` nor `termsig`."
+ raise ArgumentError, "Status neither has `exitstatus` nor `termsig`."
end
s = +"Failure while executing; `#{redacted_cmd}` #{reason}." | false |
Other | Homebrew | brew | 09132be32a163d83895081b0ddd02a314b4b54b6.json | docs: use list for common disable reasons
Co-Authored-By: Adrian Ho <the.gromgit@gmail.com> | docs/Deprecating-Disabling-and-Removing-Formulae.md | @@ -34,7 +34,12 @@ If a user attempts to install a disabled formula, they will be shown an error me
A formula should be disabled to indicate to users that the formula cannot be used and will be removed in the future. Disabled formulae may no longer build from source or have working bottles.
-The most common reasons for disabling are when the formula cannot be built from source (meaning no bottles can be built), the formula has been deprecated for a long time, the upstream repository has been removed, or the project has no license.
+The most common reasons for disabling a formula are:
+
+- it cannot be built from source (meaning no bottles can be built)
+- it has been deprecated for a long time
+- the upstream repository has been removed
+- the project has no license
**Note: disabled formulae in homebrew/core will be automatically removed one year after their disable date**
| false |
Other | Homebrew | brew | fef4512b35fb30eaf5a3efbf2de675077bab5089.json | Livecheck: Pass regex into strategy blocks | Library/Homebrew/livecheck/strategy/git.rb | @@ -87,7 +87,7 @@ def self.find_versions(url, regex = nil, &block)
tags_only_debian = tags_data[:tags].all? { |tag| tag.start_with?("debian/") }
if block
- case (value = block.call(tags_data[:tags]))
+ case (value = block.call(tags_data[:tags], regex))
when String
match_data[:matches][value] = Version.new(value)
when Array | true |
Other | Homebrew | brew | fef4512b35fb30eaf5a3efbf2de675077bab5089.json | Livecheck: Pass regex into strategy blocks | Library/Homebrew/livecheck/strategy/header_match.rb | @@ -45,7 +45,7 @@ def self.find_versions(url, regex, &block)
merged_headers = headers.reduce(&:merge)
if block
- match = block.call(merged_headers)
+ match = block.call(merged_headers, regex)
else
match = nil
| true |
Other | Homebrew | brew | fef4512b35fb30eaf5a3efbf2de675077bab5089.json | Livecheck: Pass regex into strategy blocks | Library/Homebrew/livecheck/strategy/page_match.rb | @@ -49,7 +49,7 @@ def self.match?(url)
# @return [Array]
def self.page_matches(content, regex, &block)
if block
- case (value = block.call(content))
+ case (value = block.call(content, regex))
when String
return [value]
when Array | true |
Other | Homebrew | brew | 3a6f34d27bc654d41c274c4ef469f89c2d93be70.json | cli/parser: add tests for inferring option names | Library/Homebrew/test/cli/parser_spec.rb | @@ -252,6 +252,42 @@
end
end
+ describe "test inferrability of args" do
+ subject(:parser) {
+ described_class.new do
+ switch "--switch-a"
+ switch "--switch-b"
+ switch "--foo-switch"
+ flag "--flag-foo="
+ comma_array "--comma-array-foo"
+ end
+ }
+
+ it "parses a valid switch that uses `_` instead of `-`" do
+ args = parser.parse(["--switch_a"])
+ expect(args).to be_switch_a
+ end
+
+ it "parses a valid flag that uses `_` instead of `-`" do
+ args = parser.parse(["--flag_foo=foo.txt"])
+ expect(args.flag_foo).to eq "foo.txt"
+ end
+
+ it "parses a valid comma_array that uses `_` instead of `-`" do
+ args = parser.parse(["--comma_array_foo=foo.txt,bar.txt"])
+ expect(args.comma_array_foo).to eq %w[foo.txt bar.txt]
+ end
+
+ it "raises an error when option is ambiguous" do
+ expect { parser.parse(["--switch"]) }.to raise_error(RuntimeError, /ambiguous option: --switch/)
+ end
+
+ it "inferrs the option from an abbreviated name" do
+ args = parser.parse(["--foo"])
+ expect(args).to be_foo_switch
+ end
+ end
+
describe "test argv extensions" do
subject(:parser) {
described_class.new do | false |
Other | Homebrew | brew | 5b360f35c534a881e045fd51474e3982dad63c11.json | update-report: use gitconfig to remember last tag | Library/Homebrew/cmd/update-report.rb | @@ -89,7 +89,21 @@ def update_report
puts "Updated Homebrew from #{shorten_revision(initial_revision)} to #{shorten_revision(current_revision)}."
updated = true
- new_repository_version = Utils.safe_popen_read("git", "tag", "--points-at", "HEAD").chomp.presence
+ old_tag = if (HOMEBREW_REPOSITORY/".git/config").exist?
+ Utils.popen_read(
+ "git", "config", "--file=#{HOMEBREW_REPOSITORY}/.git/config", "--get", "homebrew.latesttag"
+ ).chomp.presence
+ end
+
+ new_tag = Utils.popen_read(
+ "git", "-C", HOMEBREW_REPOSITORY, "tag", "--list", "--sort=-version:refname"
+ ).lines.first.chomp
+
+ if new_tag != old_tag
+ system "git", "config", "--file=#{HOMEBREW_REPOSITORY}/.git/config",
+ "--replace-all", "homebrew.latesttag", new_tag
+ new_repository_version = new_tag
+ end
end
Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"] | false |
Other | Homebrew | brew | 90868fff3466f62b2fb2ecf119f48b8c7039c8d5.json | cmd/list: Remove help text about `-l` displaying file sizes
- It doesn't work on the `HOMEBREW_CELLAR` dir for some reason, and
using `du -sh` instead (PR 10131) was an extra call that we don't
need.
- (I had to edit the man page manually as `brew man` gives me "Broken
pipe" errors.) | Library/Homebrew/cmd/list.rb | @@ -48,8 +48,7 @@ def list_args
"This is the default when output is not to a terminal."
switch "-l",
depends_on: "--formula",
- description: "List formulae in long format. If the output is to a terminal, "\
- "a total sum for all the file sizes is printed before the long listing."
+ description: "List formulae in long format."
switch "-r",
depends_on: "--formula",
description: "Reverse the order of the formulae sort to list the oldest entries first." | true |
Other | Homebrew | brew | 90868fff3466f62b2fb2ecf119f48b8c7039c8d5.json | cmd/list: Remove help text about `-l` displaying file sizes
- It doesn't work on the `HOMEBREW_CELLAR` dir for some reason, and
using `du -sh` instead (PR 10131) was an extra call that we don't
need.
- (I had to edit the man page manually as `brew man` gives me "Broken
pipe" errors.) | docs/Manpage.md | @@ -339,7 +339,7 @@ If *`cask`* is provided, list its artifacts.
* `-1`:
Force output to be one entry per line. This is the default when output is not to a terminal.
* `-l`:
- List formulae in long format. If the output is to a terminal, a total sum for all the file sizes is printed before the long listing.
+ List formulae in long format.
* `-r`:
Reverse the order of the formulae sort to list the oldest entries first.
* `-t`: | true |
Other | Homebrew | brew | 90868fff3466f62b2fb2ecf119f48b8c7039c8d5.json | cmd/list: Remove help text about `-l` displaying file sizes
- It doesn't work on the `HOMEBREW_CELLAR` dir for some reason, and
using `du -sh` instead (PR 10131) was an extra call that we don't
need.
- (I had to edit the man page manually as `brew man` gives me "Broken
pipe" errors.) | manpages/brew.1 | @@ -468,7 +468,7 @@ Force output to be one entry per line\. This is the default when output is not t
.
.TP
\fB\-l\fR
-List formulae in long format\. If the output is to a terminal, a total sum for all the file sizes is printed before the long listing\.
+List formulae in long format\.
.
.TP
\fB\-r\fR | true |
Other | Homebrew | brew | b125bd92cf6cc4042716d499c816db89334d8b31.json | docs: incorporate changes from code review
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | docs/Deprecating-Disabling-and-Removing-Formulae.md | @@ -8,13 +8,13 @@ This general rule of thumb can be followed:
- `deprecate!` should be used for formulae that _should_ no longer be used.
- `disable!` should be used for formulae that _cannot_ be used.
-- Formulae that have are not longer acceptable in homebrew/core or have been disabled for over a year should be removed.
+- Formulae that are no longer acceptable in homebrew/core or have been disabled for over a year should be removed.
## Deprecation
If a user attempts to install a deprecated formula, they will be shown a warning message but the install will succeed.
-A formula should be deprecated to indicate to users that the formula should not be used and may be disabled in the future. Deprecated formulae should still be able to build from source and their bottles should continue to work.
+A formula should be deprecated to indicate to users that the formula should not be used and may be disabled in the future. Deprecated formulae should still build from source and their bottles should continue to work.
The most common reasons for deprecation are when the upstream project is deprecated, unmaintained, or archived.
@@ -26,15 +26,15 @@ deprecate! date: "YYYY-MM-DD", because: :reason
The `date` parameter should be set to the date that the project or version became (or will become) deprecated. If there is no clear date but the formula needs to be deprecated, use today's date. If the `date` parameter is set to a date in the future, the formula will not become deprecated until that date. This can be useful if the upstream developers have indicated a date where the project or version will stop being supported.
-The `because` parameter can be set to a preset reason (using a symbol) or a custom reason. See the [Deprecate and Disable Reasons](#deprecate-and-disable-reasons) section below for more details about the `because` parameter.
+The `because` parameter can be a preset reason (using a symbol) or a custom reason. See the [Deprecate and Disable Reasons](#deprecate-and-disable-reasons) section below for more details about the `because` parameter.
## Disabling
If a user attempts to install a disabled formula, they will be shown an error message and the install will fail.
-A formula should be disabled to indicate to users that the formula cannot be used and will be removed in the future. Disabled formulae may no longer be able to build from source or have working bottles.
+A formula should be disabled to indicate to users that the formula cannot be used and will be removed in the future. Disabled formulae may no longer build from source or have working bottles.
-The most common reasons for disabling are when the formula cannot be built from source (meaning no bottles can be built), has been deprecated for a long time, the upstream repository has been removed, or the project has no license.
+The most common reasons for disabling are when the formula cannot be built from source (meaning no bottles can be built), the formula has been deprecated for a long time, the upstream repository has been removed, or the project has no license.
**Note: disabled formulae in homebrew/core will be automatically removed one year after their disable date**
@@ -46,7 +46,7 @@ disable! date: "YYYY-MM-DD", because: :reason
The `date` parameter should be set to the date that the reason for disabling came into effect. If there is no clear date but the formula needs to be disabled, use today's date. If the `date` parameter is set to a date in the future, the formula will be deprecated until that date (on which the formula will become disabled).
-The `because` parameter can be set to a preset reason (using a symbol) or a custom reason. See the [Deprecate and Disable Reasons](#deprecate-and-disable-reasons) section below for more details about the `because` parameter.
+The `because` parameter can be a preset reason (using a symbol) or a custom reason. See the [Deprecate and Disable Reasons](#deprecate-and-disable-reasons) section below for more details about the `because` parameter.
## Removal
| false |
Other | Homebrew | brew | 5a1adeae06a6660d43274e10bb60d5d14b7cd178.json | docs: incorporate changes from code review
Co-Authored-By: Seeker <meaningseeking@protonmail.com>
Co-Authored-By: Sean Molenaar <smillerdev@me.com>
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Michka Popoff <3406519+iMichka@users.noreply.github.com> | docs/Deprecating-Disabling-and-Removing-Formulae.md | @@ -6,15 +6,15 @@ There are many reasons why formulae may be deprecated, disabled, or removed. Thi
This general rule of thumb can be followed:
-- `deprecate!` should be used for formulae that _should_ no longer be used
-- `disable!` should be used for formulae that _cannot_ be used
-- Formulae that have been disabled for a long time or have a more serious issue should be removed
+- `deprecate!` should be used for formulae that _should_ no longer be used.
+- `disable!` should be used for formulae that _cannot_ be used.
+- Formulae that have are not longer acceptable in homebrew/core or have been disabled for over a year should be removed.
## Deprecation
If a user attempts to install a deprecated formula, they will be shown a warning message but the install will succeed.
-A formula should be deprecated to indicate to users that the formula should not be used and may be disabled in the future. Deprecated formulae should still be able to build from source and all bottles should continue to work. Users who choose to install deprecated formulae should not have any issues.
+A formula should be deprecated to indicate to users that the formula should not be used and may be disabled in the future. Deprecated formulae should still be able to build from source and their bottles should continue to work.
The most common reasons for deprecation are when the upstream project is deprecated, unmaintained, or archived.
@@ -24,15 +24,15 @@ To deprecate a formula, add a `deprecate!` call. This call should include a depr
deprecate! date: "YYYY-MM-DD", because: :reason
```
-The `date` parameter should be set to the date that the project became (or will become) deprecated. If there is no clear date but the formula needs to be deprecated, use today's date. If the `date` parameter is set to a date in the future, the formula will not become deprecated until that date. This can be useful if the upstream developers have indicated a date where the project will stop being supported.
+The `date` parameter should be set to the date that the project or version became (or will become) deprecated. If there is no clear date but the formula needs to be deprecated, use today's date. If the `date` parameter is set to a date in the future, the formula will not become deprecated until that date. This can be useful if the upstream developers have indicated a date where the project or version will stop being supported.
The `because` parameter can be set to a preset reason (using a symbol) or a custom reason. See the [Deprecate and Disable Reasons](#deprecate-and-disable-reasons) section below for more details about the `because` parameter.
## Disabling
If a user attempts to install a disabled formula, they will be shown an error message and the install will fail.
-A formula should be disabled to indicate to users that the formula cannot be used and may be removed in the future. Disabled formulae may not be able to build from source and may not have working bottles. Users who choose to attempt to install disabled formulae will likely run into issues.
+A formula should be disabled to indicate to users that the formula cannot be used and will be removed in the future. Disabled formulae may no longer be able to build from source or have working bottles.
The most common reasons for disabling are when the formula cannot be built from source (meaning no bottles can be built), has been deprecated for a long time, the upstream repository has been removed, or the project has no license.
@@ -50,20 +50,18 @@ The `because` parameter can be set to a preset reason (using a symbol) or a cust
## Removal
-A formula should be removed if there is a serious issue with the formula or the formula has been disabled for a long period of time.
-
-A formula should be removed if it has been disabled for a long period of time, it has a non-open-source license, or there is another serious issue with the formula that makes it not compatible with homebrew/core.
+A formula should be removed if it does not meet our criteria for [acceptable formulae](Acceptable-Formulae.md) or [versioned formulae](Versions.md), has a non-open-source license, or has been disabled for a long period of time.
**Note: disabled formulae in homebrew/core will be automatically removed one year after their disable date**
## Deprecate and Disable Reasons
-When a formula is deprecated or disabled, a reason explaining the action should be provided.
+When a formula is deprecated or disabled, a reason explaining the action must be provided.
-There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are:
+There are two ways to indicate the reason. The preferred way is to use a pre-existing symbol to indicate the reason. The available symbols are listed below and can be found in the [`DeprecateDisable` module](https://rubydoc.brew.sh/DeprecateDisable.html#DEPRECATE_DISABLE_REASONS-constant):
-- `:does_not_build`: the formulae that cannot be build from source
-- `:no_license`: the formulae does not have a license
+- `:does_not_build`: the formula cannot be built from source
+- `:no_license`: the formula does not have a license
- `:repo_archived`: the upstream repository has been archived
- `:repo_removed`: the upstream repository has been removed
- `:unmaintained`: the project appears to be abandoned
@@ -85,24 +83,14 @@ disable! date: "2020-01-01", because: :does_not_build
If these pre-existing reasons do not fit, a custom reason can be specified. These reasons should be written to fit into the sentence `<formula> has been deprecated/disabled because it <reason>!`.
-Here are examples of a well-worded custom reason:
+A well-worded example of a custom reason would be:
```ruby
# Warning: <formula> has been deprecated because it fetches unversioned dependencies at runtime!
deprecate! date: "2020-01-01", because: "fetches unversioned dependencies at runtime"
```
-```ruby
-# Error: <formula> has been disabled because it requires Python 2.7!
-disable! date: "2020-01-01", because: "requires Python 2.7"
-```
-
-Here is an example of a poorly-worded custom reason:
-
-```ruby
-# Warning: <formula> has been deprecated because it the formula fetches unversioned dependencies at runtime!
-deprecate! date: "2020-01-01", because: "the formula fetches unversioned dependencies at runtime"
-```
+A poorly-worded example of a custom reason would be:
```ruby
# Error: <formula> has been disabled because it invalid license! | true |
Other | Homebrew | brew | 5a1adeae06a6660d43274e10bb60d5d14b7cd178.json | docs: incorporate changes from code review
Co-Authored-By: Seeker <meaningseeking@protonmail.com>
Co-Authored-By: Sean Molenaar <smillerdev@me.com>
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Co-Authored-By: Michka Popoff <3406519+iMichka@users.noreply.github.com> | docs/Formula-Cookbook.md | @@ -795,6 +795,10 @@ You can set environment variables in a formula's `install` method using `ENV["VA
In summary, environment variables used by a formula need to conform to these filtering rules in order to be available.
+### Deprecating and disabling a formula
+
+See our [Deprecating, Disabling, and Removing Formulae](Deprecating-Disabling-and-Removing-Formulae.md) documentation for more information about how and when to deprecate or disable a formula.
+
## Updating formulae
Eventually a new version of the software will be released. In this case you should update the [`url`](https://rubydoc.brew.sh/Formula#url-class_method) and [`sha256`](https://rubydoc.brew.sh/Formula#sha256%3D-class_method). If a [`revision`](https://rubydoc.brew.sh/Formula#revision%3D-class_method) line exists outside any `bottle do` block it should be removed. | true |
Other | Homebrew | brew | 844363c7477fe3cd01043cc08ff96aa23511b43f.json | Fix description cache path in Fish completion | completions/fish/brew.fish | @@ -93,11 +93,9 @@ function __fish_brew_suggest_formulae_all -d 'Lists all available formulae with
set -q __brew_cache_path
or set -gx __brew_cache_path (brew --cache)
- # TODO: Probably drop this since I think that desc_cache.json is no longer generated. Is there a different available cache?
- if test -f "$__brew_cache_path/desc_cache.json"
- __fish_brew_ruby_parse_json "$__brew_cache_path/desc_cache.json" \
+ if test -f "$__brew_cache_path/descriptions.json"
+ __fish_brew_ruby_parse_json "$__brew_cache_path/descriptions.json" \
'.each{ |k, v| puts([k, v].reject(&:nil?).join("\t")) }'
- # backup: (note that it lists only formulae names without descriptions)
else
brew formulae
end | false |
Other | Homebrew | brew | 8b5e334be48f0589a5d0c1fc376e161ff73ea49e.json | PageMatch: Require provided_content to be a string | Library/Homebrew/livecheck/strategy/page_match.rb | @@ -88,7 +88,7 @@ def self.page_matches(content, regex, &block)
def self.find_versions(url, regex, provided_content = nil, &block)
match_data = { matches: {}, regex: regex, url: url }
- content = if provided_content.present?
+ content = if provided_content.is_a?(String)
provided_content
else
match_data.merge!(Strategy.page_content(url)) | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.