settings: typed: strict
This commit is contained in:
parent
dde6703237
commit
16bc592e08
@ -276,7 +276,7 @@ module Homebrew
|
||||
puts
|
||||
|
||||
new_major_version, new_minor_version, new_patch_version = new_tag.split(".").map(&:to_i)
|
||||
old_major_version, old_minor_version = old_tag.split(".")[0, 2].map(&:to_i) if old_tag.present?
|
||||
old_major_version, old_minor_version = T.must(old_tag.split(".")[0, 2]).map(&:to_i) if old_tag.present?
|
||||
if old_tag.blank? || new_major_version > old_major_version || new_minor_version > old_minor_version
|
||||
puts <<~EOS
|
||||
The #{new_major_version}.#{new_minor_version}.0 release notes are available on the Homebrew Blog:
|
||||
|
@ -1,4 +1,4 @@
|
||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "utils/popen"
|
||||
@ -6,6 +6,10 @@ require "utils/popen"
|
||||
module Homebrew
|
||||
# Helper functions for reading and writing settings.
|
||||
module Settings
|
||||
sig {
|
||||
params(setting: T.any(String, Symbol), repo: Pathname)
|
||||
.returns(T.nilable(String))
|
||||
}
|
||||
def self.read(setting, repo: HOMEBREW_REPOSITORY)
|
||||
return unless (repo/".git/config").exist?
|
||||
|
||||
@ -16,6 +20,7 @@ module Homebrew
|
||||
value
|
||||
end
|
||||
|
||||
sig { params(setting: T.any(String, Symbol), value: T.any(String, T::Boolean), repo: Pathname).void }
|
||||
def self.write(setting, value, repo: HOMEBREW_REPOSITORY)
|
||||
return unless (repo/".git/config").exist?
|
||||
|
||||
@ -26,6 +31,7 @@ module Homebrew
|
||||
Kernel.system("git", "-C", repo.to_s, "config", "--replace-all", "homebrew.#{setting}", value, exception: true)
|
||||
end
|
||||
|
||||
sig { params(setting: T.any(String, Symbol), repo: Pathname).void }
|
||||
def self.delete(setting, repo: HOMEBREW_REPOSITORY)
|
||||
return unless (repo/".git/config").exist?
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user