Merge pull request #13989 from issyl0/sorbet-rbi-is-in-maintenance
This commit is contained in:
commit
8684f953f6
@ -34,6 +34,7 @@ gem "warning", require: false
|
||||
group :sorbet, optional: true do
|
||||
gem "parlour", require: false
|
||||
gem "sorbet-static-and-runtime", require: false
|
||||
gem "spoom", require: false
|
||||
gem "tapioca", require: false
|
||||
end
|
||||
|
||||
|
||||
@ -236,6 +236,7 @@ DEPENDENCIES
|
||||
simplecov-cobertura
|
||||
sorbet-runtime
|
||||
sorbet-static-and-runtime
|
||||
spoom
|
||||
tapioca
|
||||
warning
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cask/artifact/moved"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cask/artifact/relocated"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "plist"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cask/artifact/moved"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cask/artifact/relocated"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "language/python"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "formula"
|
||||
|
||||
@ -68,38 +68,11 @@ module Homebrew
|
||||
safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args
|
||||
safe_system "bundle", "exec", "parlour"
|
||||
safe_system "bundle", "exec", "srb", "rbi", "hidden-definitions"
|
||||
safe_system "bundle", "exec", "srb", "rbi", "todo"
|
||||
safe_system "bundle", "exec", "tapioca", "todo"
|
||||
|
||||
if args.suggest_typed?
|
||||
result = system_command(
|
||||
"bundle",
|
||||
args: ["exec", "--", "srb", "tc", "--suggest-typed", "--typed=strict",
|
||||
"--isolate-error-code=7022"],
|
||||
print_stderr: false,
|
||||
)
|
||||
|
||||
allowed_changes = {
|
||||
"false" => ["true", "strict"],
|
||||
"true" => ["strict"],
|
||||
}
|
||||
|
||||
# Workaround for `srb tc rbi suggest-typed`, which currently fails get to a converging state.
|
||||
result.stderr.scan(/^(.*\.rb):\d+:\s+You could add `#\s*typed:\s*(.*?)`/).each do |path, new_level|
|
||||
path = Pathname(path)
|
||||
|
||||
next unless path.file?
|
||||
|
||||
contents = path.read
|
||||
|
||||
next unless (match = contents.match(/\A\s*#\s*typed:\s*([^\s]+)/))
|
||||
|
||||
existing_level = match[1]
|
||||
|
||||
next unless allowed_changes.fetch(existing_level, []).include?(new_level)
|
||||
|
||||
puts "#{path}: #{existing_level} -> #{new_level}"
|
||||
path.atomic_write contents.sub(/\A(\s*#\s*typed:\s*)(?:[^\s]+)/, "\\1#{new_level}")
|
||||
end
|
||||
ohai "Bumping Sorbet `typed` sigils..."
|
||||
safe_system "bundle", "exec", "spoom", "bump"
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cli/parser"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "extend/os/linux/args" if OS.linux?
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Homebrew
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Homebrew
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "extend/os/linux/parser" if OS.linux?
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
# List of formulae that had a revision in linuxbrew-core
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "open3"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "forwardable"
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
||||
# srb rbi todo
|
||||
# DO NOT EDIT MANUALLY
|
||||
# This is an autogenerated file for unresolved constants.
|
||||
# Please instead update this file by running `bin/tapioca todo`.
|
||||
|
||||
# typed: false
|
||||
|
||||
# typed: strong
|
||||
module ::StackProf; end
|
||||
module T::InterfaceWrapper::Helpers; end
|
||||
module T::Private::Abstract::Hooks; end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
module UnpackStrategy
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "fcntl"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env ruby
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "../standalone"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# typed: false
|
||||
# typed: true
|
||||
# frozen_string_literal: true
|
||||
|
||||
# from https://github.com/lsegal/yard/issues/484#issuecomment-442586899
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user