Suppress sorbet type errors when using `undef'

This commit is contained in:
Douglas Eichelberger 2024-08-15 07:59:49 -07:00
parent bbe3584168
commit 70b072a7d0
11 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
module Homebrew module Homebrew

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
module Homebrew module Homebrew

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
class Cleaner class Cleaner

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
module Homebrew module Homebrew

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
class Formula class Formula

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
class FormulaInstaller class FormulaInstaller

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
class LinkageChecker class LinkageChecker

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
module Readall module Readall

View File

@ -1,4 +1,4 @@
# typed: true # rubocop:disable Sorbet/StrictSigil # typed: strict
# frozen_string_literal: true # frozen_string_literal: true
module Homebrew module Homebrew

View File

@ -4,4 +4,5 @@
--ignore=/vendor/gems --ignore=/vendor/gems
--ignore=/vendor/portable-ruby --ignore=/vendor/portable-ruby
--ignore=/test/.gem --ignore=/test/.gem
--suppress-error-code=3008
--suppress-error-code=7019 --suppress-error-code=7019

View File

@ -31,6 +31,9 @@ module Tapioca
sig { override.void } sig { override.void }
def decorate def decorate
cmd = T.cast(constant, T.class_of(Homebrew::AbstractCommand)) cmd = T.cast(constant, T.class_of(Homebrew::AbstractCommand))
# This is a dummy class to make the `brew` command parsable
return if cmd.name == "Homebrew::Cmd::Brew"
args_class_name = T.must(T.must(cmd.args_class).name) args_class_name = T.must(T.must(cmd.args_class).name)
root.create_class(args_class_name, superclass_name: "Homebrew::CLI::Args") do |klass| root.create_class(args_class_name, superclass_name: "Homebrew::CLI::Args") do |klass|
create_args_methods(klass, cmd.parser) create_args_methods(klass, cmd.parser)