rbi 0.1.12 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6adcac6e5c1e3bd67450e6b9e92f471d970831aacc69e94e7893fb47536bf2ea
4
- data.tar.gz: fe31a8850bf7da8e69ec1e1d11936613a709b6693318cf5ed1cb01828a43182c
3
+ metadata.gz: 3705c571d4b2685e60fec1c0dc54435caed79ba988239006be0bf14757790c51
4
+ data.tar.gz: 4560dc122385781dd604cdc4ca57835caa22e3f29b2cafa5b7e2e468032c5923
5
5
  SHA512:
6
- metadata.gz: c0569fdac160bae1f049ca462c91efa27b1d94697555480dbc738563de1e069dc15e183ee31c3367325cffabcf340e87a361e3c52a89a44d32206b4e8d9889ae
7
- data.tar.gz: cb724b3d5c48bb5716b94be807be3b37c2b5ebb1a0a8f01b163c6e4a517858ff9b1691e130de51c687bd96425051e0206a2c4d71f4119c8013dbcb33ec2af134
6
+ metadata.gz: 3f70d57182bed826c64ca53ed2d62a1da0aeb0dee1badbe774ed00c8bd505b8e40f00363c4ca069efef457649cff19ce6b2be595e6dca453e56456eb4580ca38
7
+ data.tar.gz: 5c60fedeeb8995f9e6ed4ef926f68870ed88021de20e60294e1aec97029c728f24d098a8d297ec967dbfc23c31788dbb30d82b8f925f1c95962df7772580c294
data/Gemfile CHANGED
@@ -9,8 +9,8 @@ group(:development, :test) do
9
9
  gem("byebug")
10
10
  gem("minitest")
11
11
  gem("minitest-reporters")
12
- gem("rake", "~> 13.1")
13
- gem("rubocop", "~> 1.62", require: false)
12
+ gem("rake", "~> 13.2")
13
+ gem("rubocop", "~> 1.65", require: false)
14
14
  gem("rubocop-shopify", require: false)
15
15
  gem("rubocop-sorbet", require: false)
16
16
  gem("sorbet", ">= 0.5.9204", require: false)
data/lib/rbi/formatter.rb CHANGED
@@ -8,18 +8,6 @@ module RBI
8
8
  sig { params(sort_nodes: T::Boolean).returns(T::Boolean) }
9
9
  attr_writer :sort_nodes
10
10
 
11
- sig { params(nest_singleton_methods: T::Boolean).returns(T::Boolean) }
12
- attr_writer :nest_singleton_methods
13
-
14
- sig { params(add_sig_templates: T::Boolean).returns(T::Boolean) }
15
- attr_writer :add_sig_templates
16
-
17
- sig { params(group_nodes: T::Boolean).returns(T::Boolean) }
18
- attr_writer :group_nodes
19
-
20
- sig { params(nest_non_public_methods: T::Boolean).returns(T::Boolean) }
21
- attr_writer :nest_non_public_methods
22
-
23
11
  sig { returns(T.nilable(Integer)) }
24
12
  attr_accessor :max_line_length
25
13
 
data/lib/rbi/index.rb CHANGED
@@ -19,7 +19,7 @@ module RBI
19
19
 
20
20
  sig { void }
21
21
  def initialize
22
- super()
22
+ super
23
23
  @index = T.let({}, T::Hash[String, T::Array[Node]])
24
24
  end
25
25
 
data/lib/rbi/model.rb CHANGED
@@ -2,6 +2,8 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module RBI
5
+ class ReplaceNodeError < Error; end
6
+
5
7
  class Node
6
8
  extend T::Sig
7
9
  extend T::Helpers
@@ -32,10 +34,10 @@ module RBI
32
34
  sig { params(node: Node).void }
33
35
  def replace(node)
34
36
  tree = parent_tree
35
- raise unless tree
37
+ raise ReplaceNodeError, "Can't replace #{self} without a parent tree" unless tree
36
38
 
37
39
  index = tree.nodes.index(self)
38
- raise unless index
40
+ raise ReplaceNodeError, "Can't find #{self} in #{tree} child nodes" unless index
39
41
 
40
42
  tree.nodes[index] = node
41
43
  node.parent_tree = tree
data/lib/rbi/parser.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  require "prism"
5
5
 
6
6
  module RBI
7
- class ParseError < StandardError
7
+ class ParseError < Error
8
8
  extend T::Sig
9
9
 
10
10
  sig { returns(Loc) }
@@ -17,7 +17,7 @@ module RBI
17
17
  end
18
18
  end
19
19
 
20
- class UnexpectedParserError < StandardError
20
+ class UnexpectedParserError < Error
21
21
  extend T::Sig
22
22
 
23
23
  sig { returns(Loc) }
@@ -719,7 +719,7 @@ module RBI
719
719
  comments = node_comments(send)
720
720
  default_value = T.let(nil, T.nilable(String))
721
721
 
722
- rest&.each do |arg|
722
+ rest.each do |arg|
723
723
  next unless arg.is_a?(Prism::KeywordHashNode)
724
724
 
725
725
  arg.elements.each do |assoc|