Skip to content

Commit 40c58a8

Browse files
committed
Enable strict typing in Tap
1 parent 9f05f0e commit 40c58a8

File tree

4 files changed

+380
-259
lines changed

4 files changed

+380
-259
lines changed

Library/Homebrew/dev-cmd/pr-pull.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def signoff!(git_repo, pull_request: nil, dry_run: false)
207207

208208
if pull_request
209209
# This is a tap pull request and approving reviewers should also sign-off.
210-
tap = Tap.from_path(git_repo.pathname)
210+
tap = T.must(Tap.from_path(git_repo.pathname))
211211
review_trailers = GitHub.approved_reviews(tap.user, tap.full_name.split("/").last,
212212
pull_request).map do |r|
213213
"Signed-off-by: #{r["name"]} <#{r["email"]}>"
@@ -253,7 +253,7 @@ def get_package(tap, subject_name, subject_path, content)
253253
}
254254
def determine_bump_subject(old_contents, new_contents, subject_path, reason: nil)
255255
subject_path = Pathname(subject_path)
256-
tap = Tap.from_path(subject_path)
256+
tap = T.must(Tap.from_path(subject_path))
257257
subject_name = subject_path.basename.to_s.chomp(".rb")
258258
is_cask = subject_path.to_s.start_with?("#{tap.cask_dir}/")
259259
name = is_cask ? "cask" : "formula"

Library/Homebrew/dev-cmd/tap-new.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def run
4141

4242
titleized_user = tap.user.dup
4343
titleized_repository = tap.repository.dup
44-
titleized_user[0] = titleized_user[0].upcase
45-
titleized_repository[0] = titleized_repository[0].upcase
44+
titleized_user[0] = T.must(titleized_user[0]).upcase
45+
titleized_repository[0] = T.must(titleized_repository[0]).upcase
4646
# Duplicate assignment to silence `assigned but unused variable` warning
4747
root_url = root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repository}") if args.github_packages?
4848

Library/Homebrew/diagnostic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def check_casktap_integrity
548548
core_cask_tap = CoreCaskTap.instance
549549
return unless core_cask_tap.installed?
550550

551-
broken_tap(core_cask_tap) || examine_git_origin(core_cask_tap.git_repository, core_cask_tap.remote)
551+
broken_tap(core_cask_tap) || examine_git_origin(core_cask_tap.git_repository, T.must(core_cask_tap.remote))
552552
end
553553

554554
sig { returns(T.nilable(String)) }

0 commit comments

Comments
 (0)