rbi 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/rbi/loc.rb +7 -0
- data/lib/rbi/rbs_printer.rb +14 -5
- data/lib/rbi/version.rb +1 -1
- data/rbi/rbi.rbi +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af8e924ba9ce66ae6e351504d2b2da1e93429a6542135cef93807e834fd1a8b0
|
|
4
|
+
data.tar.gz: eaafc512384efa9d227cea70b6c04a7d029d9ba042453ff4633bc1c126c7b3e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 102f99d5c740b776135b3dec665a041661de0ad7458033734dc85bb6b2e652e5ba8da65141ac3302efd9b593cf5c86d6a850e9c4b8ed76cc6c5c377ac73dd19c
|
|
7
|
+
data.tar.gz: 7c3c11b6aac1ca23793adb2e47c1053b79fd44d209dca2bfe0e0414ca20f3d2f8e46dc2b67a898e7ecb84cca3a264492d4e652f9a954783437e87ede226d602d
|
data/Gemfile
CHANGED
|
@@ -10,7 +10,7 @@ group(:development, :test) do
|
|
|
10
10
|
gem("minitest")
|
|
11
11
|
gem("minitest-reporters")
|
|
12
12
|
gem("rake", "~> 13.4")
|
|
13
|
-
gem("rubocop", "~> 1.
|
|
13
|
+
gem("rubocop", "~> 1.88", 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/loc.rb
CHANGED
data/lib/rbi/rbs_printer.rb
CHANGED
|
@@ -25,9 +25,17 @@ module RBI
|
|
|
25
25
|
#| ?indent: Integer,
|
|
26
26
|
#| ?print_locs: bool,
|
|
27
27
|
#| ?positional_names: bool,
|
|
28
|
-
#| ?max_line_length: Integer
|
|
28
|
+
#| ?max_line_length: Integer?,
|
|
29
|
+
#| ?force_multiline_signatures: bool
|
|
29
30
|
#| ) -> void
|
|
30
|
-
def initialize(
|
|
31
|
+
def initialize(
|
|
32
|
+
out: $stdout,
|
|
33
|
+
indent: 0,
|
|
34
|
+
print_locs: false,
|
|
35
|
+
positional_names: true,
|
|
36
|
+
max_line_length: nil,
|
|
37
|
+
force_multiline_signatures: false
|
|
38
|
+
)
|
|
31
39
|
super()
|
|
32
40
|
@out = out
|
|
33
41
|
@current_indent = indent
|
|
@@ -36,6 +44,7 @@ module RBI
|
|
|
36
44
|
@previous_node = nil #: Node?
|
|
37
45
|
@positional_names = positional_names #: bool
|
|
38
46
|
@max_line_length = max_line_length #: Integer?
|
|
47
|
+
@force_multiline_signatures = force_multiline_signatures #: bool
|
|
39
48
|
end
|
|
40
49
|
|
|
41
50
|
# Printing
|
|
@@ -406,10 +415,10 @@ module RBI
|
|
|
406
415
|
@out = old_out
|
|
407
416
|
|
|
408
417
|
max_line_length = @max_line_length
|
|
409
|
-
if
|
|
410
|
-
print(new_out.string)
|
|
411
|
-
else
|
|
418
|
+
if @force_multiline_signatures || (max_line_length && new_out.string.size > max_line_length)
|
|
412
419
|
print_method_sig_multiline(node, sig)
|
|
420
|
+
else
|
|
421
|
+
print(new_out.string)
|
|
413
422
|
end
|
|
414
423
|
end
|
|
415
424
|
|
data/lib/rbi/version.rb
CHANGED
data/rbi/rbi.rbi
CHANGED
|
@@ -600,6 +600,9 @@ class RBI::Loc
|
|
|
600
600
|
sig { params(other: ::RBI::Loc).returns(::RBI::Loc) }
|
|
601
601
|
def join(other); end
|
|
602
602
|
|
|
603
|
+
sig { returns(T::Boolean) }
|
|
604
|
+
def multiline?; end
|
|
605
|
+
|
|
603
606
|
sig { returns(T.nilable(::String)) }
|
|
604
607
|
def source; end
|
|
605
608
|
|
|
@@ -1463,10 +1466,11 @@ class RBI::RBSPrinter < ::RBI::Visitor
|
|
|
1463
1466
|
indent: ::Integer,
|
|
1464
1467
|
print_locs: T::Boolean,
|
|
1465
1468
|
positional_names: T::Boolean,
|
|
1466
|
-
max_line_length: T.nilable(::Integer)
|
|
1469
|
+
max_line_length: T.nilable(::Integer),
|
|
1470
|
+
force_multiline_signatures: T::Boolean
|
|
1467
1471
|
).void
|
|
1468
1472
|
end
|
|
1469
|
-
def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
|
|
1473
|
+
def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil), max_line_length: T.unsafe(nil), force_multiline_signatures: T.unsafe(nil)); end
|
|
1470
1474
|
|
|
1471
1475
|
sig { returns(::Integer) }
|
|
1472
1476
|
def current_indent; end
|