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
|
group :sorbet, optional: true do
|
||||||
gem "parlour", require: false
|
gem "parlour", require: false
|
||||||
gem "sorbet-static-and-runtime", require: false
|
gem "sorbet-static-and-runtime", require: false
|
||||||
|
gem "spoom", require: false
|
||||||
gem "tapioca", require: false
|
gem "tapioca", require: false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -236,6 +236,7 @@ DEPENDENCIES
|
|||||||
simplecov-cobertura
|
simplecov-cobertura
|
||||||
sorbet-runtime
|
sorbet-runtime
|
||||||
sorbet-static-and-runtime
|
sorbet-static-and-runtime
|
||||||
|
spoom
|
||||||
tapioca
|
tapioca
|
||||||
warning
|
warning
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# 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/relocated"
|
require "cask/artifact/relocated"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "plist"
|
require "plist"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# 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/relocated"
|
require "cask/artifact/relocated"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "language/python"
|
require "language/python"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "formula"
|
require "formula"
|
||||||
|
|||||||
@ -68,38 +68,11 @@ module Homebrew
|
|||||||
safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args
|
safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args
|
||||||
safe_system "bundle", "exec", "parlour"
|
safe_system "bundle", "exec", "parlour"
|
||||||
safe_system "bundle", "exec", "srb", "rbi", "hidden-definitions"
|
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?
|
if args.suggest_typed?
|
||||||
result = system_command(
|
ohai "Bumping Sorbet `typed` sigils..."
|
||||||
"bundle",
|
safe_system "bundle", "exec", "spoom", "bump"
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "extend/os/linux/args" if OS.linux?
|
require "extend/os/linux/args" if OS.linux?
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "extend/os/linux/parser" if OS.linux?
|
require "extend/os/linux/parser" if OS.linux?
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# List of formulae that had a revision in linuxbrew-core
|
# List of formulae that had a revision in linuxbrew-core
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "open3"
|
require "open3"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "forwardable"
|
require "forwardable"
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
# This file is autogenerated. Do not edit it by hand. Regenerate it with:
|
# DO NOT EDIT MANUALLY
|
||||||
# srb rbi todo
|
# 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 ::StackProf; end
|
||||||
module T::InterfaceWrapper::Helpers; end
|
module T::InterfaceWrapper::Helpers; end
|
||||||
module T::Private::Abstract::Hooks; end
|
module T::Private::Abstract::Hooks; end
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module UnpackStrategy
|
module UnpackStrategy
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "fcntl"
|
require "fcntl"
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative "../standalone"
|
require_relative "../standalone"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# from https://github.com/lsegal/yard/issues/484#issuecomment-442586899
|
# from https://github.com/lsegal/yard/issues/484#issuecomment-442586899
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user