Issy Long 0e81efcccb
sorbet: Comment more files that can't be strict because of undef
- Found with
  `grep -rL "# typed: strict" Library/Homebrew | xargs grep -l "undef "`.
- This stops people from trying to bump them and
  getting an error that they can't fix because
  [it's a Sorbet limitation](https://sorbet.org/docs/error-reference#3008),
  wasting contributor time.
2024-08-09 18:23:00 +01:00

25 lines
649 B
Ruby

# typed: true # This cannot be `# typed: strict` due to the use of `undef`.
# frozen_string_literal: true
module Homebrew
module CLI
class Parser
undef set_default_options
undef validate_options
def set_default_options
@args["formula?"] = true if @args.respond_to?(:formula?)
end
def validate_options
return unless @args.respond_to?(:cask?)
return unless @args.cask?
# NOTE: We don't raise an error here because we don't want
# to print the help page or a stack trace.
odie "Invalid `--cask` usage: Casks do not work on Linux"
end
end
end
end