Bump various type strictnesses
This commit is contained in:
parent
28e3b37371
commit
861dea9ada
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cask/artifact/moved"
|
require "cask/artifact/moved"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cask/artifact/abstract_uninstall"
|
require "cask/artifact/abstract_uninstall"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cask/artifact/abstract_uninstall"
|
require "cask/artifact/abstract_uninstall"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "optparse"
|
require "optparse"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "utils/user"
|
require "utils/user"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "formula"
|
require "formula"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "extend/ENV"
|
require "extend/ENV"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Module
|
class Module
|
||||||
|
@ -1,21 +1,25 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module OnOS
|
module OnOS
|
||||||
|
extend T::Sig
|
||||||
|
|
||||||
# Block only executed on macOS. No-op on Linux.
|
# Block only executed on macOS. No-op on Linux.
|
||||||
# <pre>on_macos do
|
# <pre>on_macos do
|
||||||
# # Do something Mac-specific
|
# # Do something Mac-specific
|
||||||
# end</pre>
|
# end</pre>
|
||||||
|
sig { params(block: T.proc.void).void }
|
||||||
def on_macos(&block)
|
def on_macos(&block)
|
||||||
raise "No block content defined for 'on_macos' block" unless block
|
raise "No block content defined for 'on_macos' block" unless T.unsafe(block)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Block only executed on Linux. No-op on macOS.
|
# Block only executed on Linux. No-op on macOS.
|
||||||
# <pre>on_linux do
|
# <pre>on_linux do
|
||||||
# # Do something Linux-specific
|
# # Do something Linux-specific
|
||||||
# end</pre>
|
# end</pre>
|
||||||
|
sig { params(block: T.proc.void).void }
|
||||||
def on_linux(&block)
|
def on_linux(&block)
|
||||||
raise "No block content defined for 'on_linux' block" unless block
|
raise "No block content defined for 'on_linux' block" unless T.unsafe(block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Stdenv
|
module Stdenv
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Superenv
|
module Superenv
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module OnOS
|
module OnOS
|
||||||
def on_linux(&block)
|
def on_linux(&block)
|
||||||
raise "No block content defined for 'on_linux' block" unless block
|
raise "No block content defined for 'on_linux' block" unless T.unsafe(block)
|
||||||
|
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Language
|
module Language
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module OnOS
|
module OnOS
|
||||||
def on_macos(&block)
|
def on_macos(&block)
|
||||||
raise "No block content defined for 'on_macos' block" unless block
|
raise "No block content defined for 'on_macos' block" unless T.unsafe(block)
|
||||||
|
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# The Library/Homebrew/extend/os/software_spec.rb conditional logic will need to be more nuanced
|
# The Library/Homebrew/extend/os/software_spec.rb conditional logic will need to be more nuanced
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "utils/curl"
|
require "utils/curl"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "utils/github"
|
require "utils/github"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative "startup"
|
require_relative "startup"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cask_dependent"
|
require "cask_dependent"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Language
|
module Language
|
||||||
@ -6,6 +6,9 @@ module Language
|
|||||||
#
|
#
|
||||||
# @api public
|
# @api public
|
||||||
module Java
|
module Java
|
||||||
|
extend T::Sig
|
||||||
|
|
||||||
|
sig { params(version: T.nilable(String)).returns(T.nilable(Formula)) }
|
||||||
def self.find_openjdk_formula(version = nil)
|
def self.find_openjdk_formula(version = nil)
|
||||||
can_be_newer = version&.end_with?("+")
|
can_be_newer = version&.end_with?("+")
|
||||||
version = version.to_i
|
version = version.to_i
|
||||||
@ -27,19 +30,23 @@ module Language
|
|||||||
end
|
end
|
||||||
private_class_method :find_openjdk_formula
|
private_class_method :find_openjdk_formula
|
||||||
|
|
||||||
|
sig { params(version: T.nilable(String)).returns(T.nilable(Pathname)) }
|
||||||
def self.java_home(version = nil)
|
def self.java_home(version = nil)
|
||||||
find_openjdk_formula(version)&.opt_libexec
|
find_openjdk_formula(version)&.opt_libexec
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { params(version: T.nilable(String)).returns(String) }
|
||||||
def self.java_home_shell(version = nil)
|
def self.java_home_shell(version = nil)
|
||||||
java_home(version).to_s
|
java_home(version).to_s
|
||||||
end
|
end
|
||||||
private_class_method :java_home_shell
|
private_class_method :java_home_shell
|
||||||
|
|
||||||
|
sig { params(version: T.nilable(String)).returns({ JAVA_HOME: String }) }
|
||||||
def self.java_home_env(version = nil)
|
def self.java_home_env(version = nil)
|
||||||
{ JAVA_HOME: java_home_shell(version) }
|
{ JAVA_HOME: java_home_shell(version) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { params(version: T.nilable(String)).returns({ JAVA_HOME: String }) }
|
||||||
def self.overridable_java_home_env(version = nil)
|
def self.overridable_java_home_env(version = nil)
|
||||||
{ JAVA_HOME: "${JAVA_HOME:-#{java_home_shell(version)}}" }
|
{ JAVA_HOME: "${JAVA_HOME:-#{java_home_shell(version)}}" }
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "lock_file"
|
require "lock_file"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "formulary"
|
require "formulary"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Helper functions for generating release notes.
|
# Helper functions for generating release notes.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "rubocops/extend/formula"
|
require "rubocops/extend/formula"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "resource"
|
require "resource"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# This file should be the first `require` in all entrypoints outside the `brew` environment.
|
# This file should be the first `require` in all entrypoints outside the `brew` environment.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# This file should be the first `require` in all entrypoints of `brew`.
|
# This file should be the first `require` in all entrypoints of `brew`.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
if ENV["HOMEBREW_SORBET_RUNTIME"]
|
if ENV["HOMEBREW_SORBET_RUNTIME"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user