Bump various type strictnesses

This commit is contained in:
Bo Anderson 2021-09-11 01:00:23 +01:00
parent 28e3b37371
commit 861dea9ada
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
36 changed files with 51 additions and 40 deletions

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Homebrew

View File

@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
require "cask/artifact/moved"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "cask/artifact/abstract_uninstall"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "cask/artifact/abstract_uninstall"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "optparse"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Cask

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "utils/user"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "formula"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Homebrew

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "extend/ENV"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
class Module

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

View File

@ -1,4 +1,4 @@
# typed: false
# typed: strict
# frozen_string_literal: true
module Homebrew

View File

@ -1,4 +1,4 @@
# typed: false
# typed: strict
# frozen_string_literal: true
module Homebrew

View File

@ -1,4 +1,4 @@
# typed: false
# typed: strict
# frozen_string_literal: true
module Homebrew

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Stdenv

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
module Superenv

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

View File

@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module Language

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

View File

@ -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

View File

@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module Homebrew

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "utils/curl"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "utils/github"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require_relative "startup"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "cask_dependent"

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

View File

@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
module Homebrew

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "lock_file"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "formulary"

View File

@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
# Helper functions for generating release notes.

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "rubocops/extend/formula"

View File

@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require "resource"

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.

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`.

View File

@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true
if ENV["HOMEBREW_SORBET_RUNTIME"]