Merge pull request #12037 from Bo98/type-bump

Bump various type strictnesses
This commit is contained in:
Bo Anderson
2021-09-14 02:18:38 +01:00
committed by GitHub
36 changed files with 51 additions and 40 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Homebrew
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "cask/artifact/abstract_uninstall"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "cask/artifact/abstract_uninstall"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "optparse"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Cask
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "utils/user"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "formula"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Homebrew
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "extend/ENV"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
class Module
+7 -3
View File
@@ -1,21 +1,25 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module OnOS
extend T::Sig
# Block only executed on macOS. No-op on Linux.
# <pre>on_macos do
# # Do something Mac-specific
# end</pre>
sig { params(block: T.proc.void).void }
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
# Block only executed on Linux. No-op on macOS.
# <pre>on_linux do
# # Do something Linux-specific
# end</pre>
sig { params(block: T.proc.void).void }
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
@@ -1,4 +1,4 @@
# typed: false
# typed: strict
# frozen_string_literal: true
module Homebrew
@@ -1,4 +1,4 @@
# typed: false
# typed: strict
# frozen_string_literal: true
module Homebrew
@@ -1,4 +1,4 @@
# typed: false
# typed: strict
# frozen_string_literal: true
module Homebrew
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Stdenv
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Superenv
+2 -2
View File
@@ -1,9 +1,9 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module OnOS
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
end
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module Language
+2 -2
View File
@@ -1,9 +1,9 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module OnOS
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
end
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
# The Library/Homebrew/extend/os/software_spec.rb conditional logic will need to be more nuanced
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module Homebrew
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "utils/curl"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "utils/github"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require_relative "startup"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "cask_dependent"
+8 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module Language
@@ -6,6 +6,9 @@ module Language
#
# @api public
module Java
extend T::Sig
sig { params(version: T.nilable(String)).returns(T.nilable(Formula)) }
def self.find_openjdk_formula(version = nil)
can_be_newer = version&.end_with?("+")
version = version.to_i
@@ -27,19 +30,23 @@ module Language
end
private_class_method :find_openjdk_formula
sig { params(version: T.nilable(String)).returns(T.nilable(Pathname)) }
def self.java_home(version = nil)
find_openjdk_formula(version)&.opt_libexec
end
sig { params(version: T.nilable(String)).returns(String) }
def self.java_home_shell(version = nil)
java_home(version).to_s
end
private_class_method :java_home_shell
sig { params(version: T.nilable(String)).returns({ JAVA_HOME: String }) }
def self.java_home_env(version = nil)
{ JAVA_HOME: java_home_shell(version) }
end
sig { params(version: T.nilable(String)).returns({ JAVA_HOME: String }) }
def self.overridable_java_home_env(version = nil)
{ JAVA_HOME: "${JAVA_HOME:-#{java_home_shell(version)}}" }
end
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module Homebrew
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "lock_file"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "formulary"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
# Helper functions for generating release notes.
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "rubocops/extend/formula"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "resource"
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
# This file should be the first `require` in all entrypoints outside the `brew` environment.
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
# This file should be the first `require` in all entrypoints of `brew`.
+1 -1
View File
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
if ENV["HOMEBREW_SORBET_RUNTIME"]