Skip to content

Commit

Permalink
Fix brew style docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Oct 8, 2024
1 parent a04e83a commit 7b4f50d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions Library/Homebrew/cli/named_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

require "delegate"
require "cli/args"
require "cask/cask_loader"

module Homebrew
module CLI
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

require "livecheck/constants"

# avoid circular require
# rubocop:disable Lint/EmptyClass
module Cask; class Cask; end; end
# rubocop:enable Lint/EmptyClass

# The {Livecheck} class implements the DSL methods used in a formula's, cask's
# or resource's `livecheck` block and stores related instance variables. Most
Expand Down
10 changes: 6 additions & 4 deletions Library/Homebrew/sorbet/tapioca/compilers/on_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
module Tapioca
module Compilers
class OnSystemCompiler < Tapioca::Dsl::Compiler
ConstantType = type_member { { fixed: T.any(T::Class[OnSystem::MacOSAndLinux], T::Class[OnSystem::MacOSOnly]) } }
ConstantType = type_member do
{ fixed: T.any(T::Class[OnSystem::MacOSAndLinux], T::Class[OnSystem::MacOSOnly]) }
end

sig { override.returns(T::Enumerable[T::Class[T.anything]]) }
def self.gather_constants
Expand All @@ -37,17 +39,17 @@ def decorate
end
klass.create_method(
"on_arch_conditional",
parameters: [
parameters: [
create_kw_opt_param("arm", type: "T.nilable(String)", default: "nil"),
create_kw_opt_param("intel", type: "T.nilable(String)", default: "nil"),
],
return_type: "T.nilable(String)"
return_type: "T.nilable(String)",
)

# from setup_macos_methods
MacOSVersion::SYMBOLS.each_key do |os_name|
klass.create_method("on_#{os_name}") do |method|
method.add_opt_param("or_condition", "nil")
method.add_opt_param("or_condition", "nil")
method.add_block_param("block")
method.add_sig(type_params: ["U"]) do |sig|
sig.add_param("or_condition", "T.nilable(Symbol)")
Expand Down

0 comments on commit 7b4f50d

Please sign in to comment.