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