Skip to content

Commit

Permalink
Merge pull request Shopify#216 from Shopify/dependabot/bundler/gem/mi…
Browse files Browse the repository at this point in the history
…nor-and-patch-56c963abc5

Bump the minor-and-patch group in /gem with 8 updates
  • Loading branch information
andyw8 authored Feb 6, 2024
2 parents 5950b2e + 4b616b8 commit 7e3ff3d
Show file tree
Hide file tree
Showing 41 changed files with 3,376 additions and 1,461 deletions.
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@ GEM
rubocop-sorbet (0.7.6)
rubocop (>= 0.90.0)
ruby-progressbar (1.13.0)
sorbet (0.5.11188)
sorbet-static (= 0.5.11188)
sorbet-runtime (0.5.11188)
sorbet-static (0.5.11188-universal-darwin)
sorbet-static (0.5.11188-x86_64-linux)
sorbet-static-and-runtime (0.5.11188)
sorbet (= 0.5.11188)
sorbet-runtime (= 0.5.11188)
sorbet (0.5.11221)
sorbet-static (= 0.5.11221)
sorbet-runtime (0.5.11221)
sorbet-static (0.5.11221-universal-darwin)
sorbet-static (0.5.11221-x86_64-linux)
sorbet-static-and-runtime (0.5.11221)
sorbet (= 0.5.11221)
sorbet-runtime (= 0.5.11221)
spoom (1.2.4)
erubi (>= 1.10.0)
sorbet-static-and-runtime (>= 0.5.10187)
syntax_tree (>= 6.1.1)
thor (>= 0.19.2)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tapioca (0.11.15)
tapioca (0.12.0)
bundler (>= 2.2.25)
netrc (>= 0.11.0)
parallel (>= 1.21.0)
Expand Down
2 changes: 1 addition & 1 deletion gem/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ gemspec
group(:development, :test) do
gem("minitest")
gem("minitest-reporters")
gem("rake", "~> 13.0")
gem("rake", "~> 13.1")
gem("debug")
end
74 changes: 41 additions & 33 deletions gem/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,73 +20,81 @@ GEM
ansi (1.5.0)
ast (2.4.2)
builder (3.2.4)
debug (1.7.1)
irb (>= 1.5.0)
reline (>= 0.3.1)
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
erubi (1.12.0)
io-console (0.6.0)
irb (1.6.2)
reline (>= 0.3.0)
json (2.6.2)
io-console (0.7.2)
irb (1.11.1)
rdoc
reline (>= 0.4.2)
json (2.7.1)
json-schema (4.1.1)
addressable (>= 2.8)
minitest (5.16.2)
language_server-protocol (3.17.0.3)
minitest (5.21.2)
minitest-reporters (1.6.1)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
netrc (0.11.0)
parallel (1.24.0)
parser (3.2.2.4)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (0.19.0)
psych (5.1.2)
stringio
public_suffix (5.0.4)
racc (1.7.3)
rainbow (3.1.1)
rake (13.0.6)
rake (13.1.0)
rbi (0.1.6)
prism (>= 0.18.0, < 0.20)
sorbet-runtime (>= 0.5.9204)
regexp_parser (2.5.0)
reline (0.3.2)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5)
rexml (3.2.5)
rubocop (1.32.0)
rexml (3.2.6)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.19.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.19.1)
parser (>= 3.1.1.0)
rubocop-shopify (2.8.0)
rubocop (~> 1.31)
rubocop-sorbet (0.6.11)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-shopify (2.14.0)
rubocop (~> 1.51)
rubocop-sorbet (0.7.6)
rubocop (>= 0.90.0)
ruby-progressbar (1.13.0)
sorbet (0.5.11188)
sorbet-static (= 0.5.11188)
sorbet-runtime (0.5.11188)
sorbet-static (0.5.11188-universal-darwin)
sorbet-static (0.5.11188-x86_64-linux)
sorbet-static-and-runtime (0.5.11188)
sorbet (= 0.5.11188)
sorbet-runtime (= 0.5.11188)
sorbet (0.5.11219)
sorbet-static (= 0.5.11219)
sorbet-runtime (0.5.11219)
sorbet-static (0.5.11219-universal-darwin)
sorbet-static (0.5.11219-x86_64-linux)
sorbet-static-and-runtime (0.5.11219)
sorbet (= 0.5.11219)
sorbet-runtime (= 0.5.11219)
spoom (1.2.4)
erubi (>= 1.10.0)
sorbet-static-and-runtime (>= 0.5.10187)
syntax_tree (>= 6.1.1)
thor (>= 0.19.2)
stringio (3.1.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tapioca (0.11.15)
tapioca (0.12.0)
bundler (>= 2.2.25)
netrc (>= 0.11.0)
parallel (>= 1.21.0)
Expand All @@ -96,7 +104,7 @@ GEM
thor (>= 1.2.0)
yard-sorbet
thor (1.3.0)
unicode-display_width (2.2.0)
unicode-display_width (2.5.0)
yard (0.9.34)
yard-sorbet (0.8.1)
sorbet-runtime (>= 0.5)
Expand All @@ -111,7 +119,7 @@ DEPENDENCIES
debug
minitest
minitest-reporters
rake (~> 13.0)
rake (~> 13.1)
rbi-central!

BUNDLED WITH
Expand Down
14 changes: 8 additions & 6 deletions gem/exe/repo
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module RBICentral
LOG
end

unless checks.any?
unless checks.any? # rubocop:disable Style/InvertibleUnlessCondition
log("No change detected. Run with `--all` to run all checks.")
return
end
Expand Down Expand Up @@ -168,14 +168,16 @@ module RBICentral
end

class Main < Thor
extend T::Sig

desc "check", "Check repo validity"
subcommand "check", RBICentral::CLI::Check

sig { returns(T::Boolean) }
def self.exit_on_failure?
true
class << self
extend T::Sig

sig { returns(T::Boolean) }
def exit_on_failure?
true
end
end
end
end
Expand Down
71 changes: 39 additions & 32 deletions gem/lib/rbi-central.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,44 @@ module RBICentral
INDEX_PATH = "index.json"
ANNOTATIONS_PATH = "rbi/annotations"

INDEX_SCHEMA = T.let({
"type": "object",
"patternProperties": {
"^.*$": {
"type": "object",
"properties": {
"dependencies": {
"description": "List of other gems that need to be installed to test the RBI contents",
"type": "array",
"items": {
INDEX_SCHEMA = T.let(
{
"type": "object",
"patternProperties": {
"^.*$": {
"type": "object",
"properties": {
"dependencies": {
"description": "List of other gems that need to be installed to test the RBI contents",
"type": "array",
"items": {
"type": "string",
"uniqueItems": true,
},
},
"requires": {
"description": "List of files to require to test the RBI contents",
"type": "array",
"items": {
"type": "string",
"uniqueItems": true,
},
},
"path": {
"description": "(Optional) Path where this gem can be installed from",
"type": "string",
"uniqueItems": true,
},
},
"requires": {
"description": "List of files to require to test the RBI contents",
"type": "array",
"items": {
"source": {
"description": "(Optional) Source where this gem can be installed from",
"type": "string",
"uniqueItems": true,
},
},
"path": {
"description": "(Optional) Path where this gem can be installed from",
"type": "string",
},
"source": {
"description": "(Optional) Source where this gem can be installed from",
"type": "string",
},
"additionalProperties": false,
},
"additionalProperties": false,
},
},
}, T::Hash[String, T.untyped])
T::Hash[String, T.untyped],
)

RUBOCOP_CONFIG = <<~YML
inherit_gem:
Expand All @@ -76,11 +79,15 @@ module RBICentral

class Error < StandardError; end

sig { params(string: String).returns(String) }
def self.filter_parser_warning(string)
string
.gsub(/warning:.*\n/, "")
.gsub(/Please.*\n/, "")
class << self
extend T::Sig

sig { params(string: String).returns(String) }
def filter_parser_warning(string)
string
.gsub(/warning:.*\n/, "")
.gsub(/Please.*\n/, "")
end
end
end

Expand Down
28 changes: 16 additions & 12 deletions gem/lib/rbi-central/cli/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run_check!(&block)

sig do
params(
block: T.proc.returns(T::Array[Error])
block: T.proc.returns(T::Array[Error]),
).void
end
def check_errors!(&block)
Expand All @@ -133,7 +133,7 @@ def check_errors!(&block)
sig do
params(
names: T::Array[String],
block: T.proc.params(repo: Repo, gem: Gem).returns(T::Array[Error])
block: T.proc.params(repo: Repo, gem: Gem).returns(T::Array[Error]),
).void
end
def check_gems!(names:, &block)
Expand Down Expand Up @@ -179,16 +179,20 @@ class ChecksSelection < T::Struct
prop :runtime, T::Boolean
prop :static, T::Boolean

sig { params(options: T::Hash[Symbol, T.untyped]).returns(ChecksSelection) }
def self.from_options(options)
ChecksSelection.new(
gem_tests: options[:gem],
index: options[:index],
rubocop: options[:rubocop],
rubygems: options[:rubygems],
runtime: options[:runtime],
static: options[:static],
)
class << self
extend T::Sig

sig { params(options: T::Hash[Symbol, T.untyped]).returns(ChecksSelection) }
def from_options(options)
ChecksSelection.new(
gem_tests: options[:gem],
index: options[:index],
rubocop: options[:rubocop],
rubygems: options[:rubygems],
runtime: options[:runtime],
static: options[:static],
)
end
end

sig { returns(T::Boolean) }
Expand Down
21 changes: 12 additions & 9 deletions gem/lib/rbi-central/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ class Error < RBICentral::Error; end
const :dependencies, T::Array[String], default: []
const :requires, T::Array[String], default: []

sig { params(name: String, object: T::Hash[String, T.untyped]).returns(Gem) }
def self.from_object(name, object = {})
Gem.new(
name: name,
path: object["path"],
source: object["source"],
dependencies: object["dependencies"] || [],
requires: object["requires"] || []
)
class << self
extend T::Sig
sig { params(name: String, object: T::Hash[String, T.untyped]).returns(Gem) }
def from_object(name, object = {})
Gem.new(
name: name,
path: object["path"],
source: object["source"],
dependencies: object["dependencies"] || [],
requires: object["requires"] || [],
)
end
end

sig { params(_args: T.untyped).returns(T::Hash[String, T.untyped]) }
Expand Down
Loading

0 comments on commit 7e3ff3d

Please sign in to comment.