From 7b4f50d5544130c105d8318b9cb1cac37c5892fd Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 7 Oct 2024 18:37:20 -0700 Subject: [PATCH] Fix brew style docs --- Library/Homebrew/cli/named_args.rb | 1 + Library/Homebrew/livecheck.rb | 3 +++ Library/Homebrew/sorbet/tapioca/compilers/on_system.rb | 10 ++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index 7d46b75450182c..5f132faca7ca74 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -3,6 +3,7 @@ require "delegate" require "cli/args" +require "cask/cask_loader" module Homebrew module CLI diff --git a/Library/Homebrew/livecheck.rb b/Library/Homebrew/livecheck.rb index 300caafdd3bedf..ab8890ed9de3be 100644 --- a/Library/Homebrew/livecheck.rb +++ b/Library/Homebrew/livecheck.rb @@ -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 diff --git a/Library/Homebrew/sorbet/tapioca/compilers/on_system.rb b/Library/Homebrew/sorbet/tapioca/compilers/on_system.rb index 292ede7bb1fc14..434aeab501d500 100644 --- a/Library/Homebrew/sorbet/tapioca/compilers/on_system.rb +++ b/Library/Homebrew/sorbet/tapioca/compilers/on_system.rb @@ -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 @@ -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)")