Enable typing in a couple more files
This commit is contained in:
parent
0d200944c8
commit
eb23a2c44a
@ -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
|
||||
|
||||
5
Library/Homebrew/commands.rbi
Normal file
5
Library/Homebrew/commands.rbi
Normal file
@ -0,0 +1,5 @@
|
||||
# typed: strict
|
||||
|
||||
module Commands
|
||||
include Kernel
|
||||
end
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "shellwords"
|
||||
|
||||
5
Library/Homebrew/exceptions.rbi
Normal file
5
Library/Homebrew/exceptions.rbi
Normal file
@ -0,0 +1,5 @@
|
||||
# typed: strict
|
||||
|
||||
module FormulaUnreadableErrorModule
|
||||
requires_ancestor { FormulaOrCaskUnavailableError }
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user