Enable typing in a couple more files

This commit is contained in:
Douglas Eichelberger 2023-03-02 18:21:53 -08:00
parent 0d200944c8
commit eb23a2c44a
4 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "completions"
@ -190,9 +190,8 @@ module Commands
# skip the comment's initial usage summary lines
comment_lines.slice(2..-1).each do |line|
if / (?<option>-[-\w]+) +(?<desc>.*)$/ =~ line
options << [option, desc]
end
match_data = / (?<option>-[-\w]+) +(?<desc>.*)$/.match(line)
options << [match_data[:option], match_data[:desc]] if match_data
end
options
end
@ -213,8 +212,10 @@ module Commands
# skip the comment's initial usage summary lines
comment_lines.slice(2..-1)&.each do |line|
if /^#: (?<desc>\w.*+)$/ =~ line
return desc.split(".").first if short
match_data = /^#: (?<desc>\w.*+)$/.match(line)
if match_data
desc = match_data[:desc]
return T.must(desc).split(".").first if short
return desc
end

View File

@ -0,0 +1,5 @@
# typed: strict
module Commands
include Kernel
end

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "shellwords"

View File

@ -0,0 +1,5 @@
# typed: strict
module FormulaUnreadableErrorModule
requires_ancestor { FormulaOrCaskUnavailableError }
end