Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
**/vendor/bundle/ruby/*/gems/csv-*/
**/vendor/bundle/ruby/*/gems/diff-lcs-*/
**/vendor/bundle/ruby/*/gems/docile-*/
**/vendor/bundle/ruby/*/gems/drb-*/
**/vendor/bundle/ruby/*/gems/ecma-re-validator-*/
**/vendor/bundle/ruby/*/gems/erubi-*/
**/vendor/bundle/ruby/*/gems/hana-*/
Expand All @@ -94,6 +95,7 @@
**/vendor/bundle/ruby/*/gems/kramdown-*/
**/vendor/bundle/ruby/*/gems/language_server-protocol-*/
**/vendor/bundle/ruby/*/gems/lint_roller-*/
**/vendor/bundle/ruby/*/gems/mcp-*/
**/vendor/bundle/ruby/*/gems/method_source-*/
**/vendor/bundle/ruby/*/gems/mini_portile2-*/
**/vendor/bundle/ruby/*/gems/minitest-*/
Expand Down
12 changes: 12 additions & 0 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,18 @@ Style/FetchEnvVar:
- "/**/Formula/**/*.rb"
- "**/Formula/**/*.rb"

# Doesn't make sense for formulae with e.g. requirements.
Style/OneClassPerFile:
Exclude:
- "**/*.rbi"
- "Taps/*/*/*.rb"
- "/**/Abstract/**/*.rb"
- "**/Abstract/**/*.rb"
- "/**/Formula/**/*.rb"
- "**/Formula/**/*.rb"
- "/**/developer/bin/*"
- "**/developer/bin/*"

# Not used for casks and formulae.
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Expand Down
32 changes: 20 additions & 12 deletions Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ GEM
csv (3.3.5)
diff-lcs (1.6.2)
docile (1.4.1)
drb (2.2.3)
elftools (1.3.1)
bindata (~> 2)
erubi (1.13.1)
hana (1.3.7)
io-console (0.8.2)
json (2.18.1)
json (2.19.0)
json-schema (6.1.0)
addressable (~> 2.8)
bigdecimal (>= 3.1, < 5)
json_schemer (2.5.0)
bigdecimal
hana (~> 1.3)
Expand All @@ -29,8 +33,11 @@ GEM
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
mcp (0.8.0)
json-schema (>= 4.1)
method_source (1.1.0)
minitest (6.0.1)
minitest (6.0.2)
drb (~> 2.0)
prism (~> 1.5)
netrc (0.11.0)
ostruct (0.6.3)
Expand Down Expand Up @@ -87,10 +94,11 @@ GEM
rspec-support (3.13.7)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.84.2)
rubocop (1.85.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
mcp (~> 0.6)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
Expand Down Expand Up @@ -133,15 +141,15 @@ GEM
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
simpleidn (0.2.3)
sorbet (0.6.12956)
sorbet-static (= 0.6.12956)
sorbet-runtime (0.6.12956)
sorbet-static (0.6.12956-aarch64-linux)
sorbet-static (0.6.12956-universal-darwin)
sorbet-static (0.6.12956-x86_64-linux)
sorbet-static-and-runtime (0.6.12956)
sorbet (= 0.6.12956)
sorbet-runtime (= 0.6.12956)
sorbet (0.6.12971)
sorbet-static (= 0.6.12971)
sorbet-runtime (0.6.12971)
sorbet-static (0.6.12971-aarch64-linux)
sorbet-static (0.6.12971-universal-darwin)
sorbet-static (0.6.12971-x86_64-linux)
sorbet-static-and-runtime (0.6.12971)
sorbet (= 0.6.12971)
sorbet-runtime (= 0.6.12971)
spoom (1.7.11)
erubi (>= 1.10.0)
prism (>= 0.28.0)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/brew_irb_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def c(config: nil)
end
end

class Symbol
class Symbol # rubocop:todo Style/OneClassPerFile
# @!visibility private
sig { params(args: Integer).returns(Formula) }
def f(*args)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cache_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def dirty?
# {CacheStore} provides methods to mutate and fetch data from a persistent
# storage mechanism.
#
class CacheStore
class CacheStore # rubocop:todo Style/OneClassPerFile
extend T::Helpers

abstract!
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/artifact/abstract_flight_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def uninstall_phase(**_options)

sig { override.returns(String) }
def summarize
directives.keys.map(&:to_s).join(", ")
directives.keys.join(", ")
end

private
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def audit_no_match

sig { void }
def audit_generic_artifacts
cask.artifacts.select { |a| a.is_a?(Artifact::Artifact) }.each do |artifact|
cask.artifacts.grep(Artifact::Artifact).each do |artifact|
unless artifact.target.absolute?
add_error "target must be absolute path for #{artifact.class.english_name} #{artifact.source}"
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(errors)
def to_s
<<~EOS
Problems with multiple casks:
#{@errors.map(&:to_s).join("\n")}
#{@errors.join("\n")}
EOS
end
end
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/cask/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def check_arch_requirements

raise CaskError,
"Cask #{@cask} depends on hardware architecture being one of " \
"[#{@cask.depends_on.arch.map(&:to_s).join(", ")}], " \
"[#{@cask.depends_on.arch.join(", ")}], " \
"but you are running #{@current_arch}."
end

Expand Down Expand Up @@ -450,7 +450,7 @@ def satisfy_cask_and_formula_dependencies
return
end

ohai "Installing dependencies: #{missing_formulae_and_casks.map(&:to_s).join(", ")}"
ohai "Installing dependencies: #{missing_formulae_and_casks.join(", ")}"
cask_installers = T.let([], T::Array[Installer])
formula_installers = T.let([], T::Array[FormulaInstaller])

Expand Down Expand Up @@ -638,7 +638,7 @@ def uninstall_artifacts(clear: false, successor: nil)
def zap
load_installed_caskfile!
uninstall_artifacts
if (zap_stanzas = @cask.artifacts.select { |a| a.is_a?(Artifact::Zap) }).empty?
if (zap_stanzas = @cask.artifacts.grep(Artifact::Zap)).empty?
opoo "No zap stanza present for Cask '#{@cask}'"
else
ohai "Dispatching zap stanza"
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/update-report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def install_from_api_message

require "extend/os/cmd/update-report"

class Reporter
class Reporter # rubocop:todo Style/OneClassPerFile
include Utils::Output::Mixin

Report = T.type_alias do
Expand Down Expand Up @@ -774,7 +774,7 @@ def diff
end
end

class ReporterHub
class ReporterHub # rubocop:todo Style/OneClassPerFile
include Utils::Output::Mixin

sig { returns(T::Array[Reporter]) }
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/compilers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module CompilerConstants
end

# Class for checking compiler compatibility for a formula.
class CompilerFailure
class CompilerFailure # rubocop:todo Style/OneClassPerFile
sig { returns(Symbol) }
attr_reader :type

Expand Down Expand Up @@ -97,7 +97,7 @@ def gcc_major(version)
end

# Class for selecting a compiler for a formula.
class CompilerSelector
class CompilerSelector # rubocop:todo Style/OneClassPerFile
include CompilerConstants

class Compiler < T::Struct
Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/completions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module Completions
:builtin_command_descriptions,
:completion_functions,
:function_mappings,
keyword_init: true,
)

COMPLETIONS_DIR = T.let((HOMEBREW_REPOSITORY/"completions").freeze, Pathname)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def inspect
end

# A collection of requirements.
class Requirements < SimpleDelegator
class Requirements < SimpleDelegator # rubocop:todo Style/OneClassPerFile
def initialize(*args)
super(Set.new(args))
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dependencies.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Dependencies < SimpleDelegator
def select(&blk); end
end

class Requirements < SimpleDelegator
class Requirements < SimpleDelegator # rubocop:todo Style/OneClassPerFile
include Enumerable
include Kernel

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def merge_temporality(deps)
end

# A dependency that's marked as "installed" on macOS
class UsesFromMacOSDependency < Dependency
class UsesFromMacOSDependency < Dependency # rubocop:todo Style/OneClassPerFile
attr_reader :bounds

sig { params(name: String, tags: T::Array[Symbol], bounds: T::Hash[Symbol, Symbol]).void }
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/description_cache_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def select(&block)
# {CaskDescriptionCacheStore} provides methods to fetch and mutate cask descriptions used
# by the `brew desc` and `brew search` commands.
#
class CaskDescriptionCacheStore < DescriptionCacheStore
class CaskDescriptionCacheStore < DescriptionCacheStore # rubocop:todo Style/OneClassPerFile
# If the database is empty `update!` it with all known casks.
#
# @return [nil]
Expand Down
4 changes: 1 addition & 3 deletions Library/Homebrew/descriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ def short_names
def short_name_counts
@short_name_counts ||= T.let(
short_names.values
.each_with_object(Hash.new(0)) do |name, counts|
counts[name] += 1
end,
.tally,
T.nilable(T::Hash[String, Integer]),
)
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def handle_formulae_and_casks(formulae_and_casks)
.values
.select { |items| items.length > 1 }
.flatten
.select { |item| item.is_a?(Cask::Cask) }
.grep(Cask::Cask)
end

ambiguous_names = []
Expand Down
Loading
Loading