Skip to content

Commit c9816d2

Browse files
committed
Migrate long RBS signature comments to multiline sigs
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
1 parent fdc4813 commit c9816d2

5 files changed

Lines changed: 48 additions & 7 deletions

File tree

lib/spoom/context/file_system.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ def list
3939
glob("*")
4040
end
4141

42-
#: (?allow_extensions: Array[String], ?allow_mime_types: Array[String], ?exclude_patterns: Array[String]) -> Array[String]
42+
#: (
43+
#| ?allow_extensions: Array[String],
44+
#| ?allow_mime_types: Array[String],
45+
#| ?exclude_patterns: Array[String]
46+
#| ) -> Array[String]
4347
def collect_files(allow_extensions: [], allow_mime_types: [], exclude_patterns: [])
4448
collector = FileCollector.new(
4549
allow_extensions: allow_extensions,

lib/spoom/coverage/d3/circle_map.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ def script
145145
end
146146

147147
class Sigils < CircleMap
148-
#: (String id, FileTree file_tree, Hash[FileTree::Node, String?] nodes_strictnesses, Hash[FileTree::Node, Float] nodes_scores) -> void
148+
#: (
149+
#| String id,
150+
#| FileTree file_tree,
151+
#| Hash[FileTree::Node, String?] nodes_strictnesses,
152+
#| Hash[FileTree::Node, Float] nodes_scores
153+
#| ) -> void
149154
def initialize(id, file_tree, nodes_strictnesses, nodes_scores)
150155
@nodes_strictnesses = nodes_strictnesses
151156
@nodes_scores = nodes_scores

lib/spoom/coverage/report.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ def pie_sigs
138138
end
139139

140140
class Map < Card
141-
#: (file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?title: String) -> void
141+
#: (
142+
#| file_tree: FileTree,
143+
#| nodes_strictnesses: Hash[FileTree::Node, String?],
144+
#| nodes_strictness_scores: Hash[FileTree::Node, Float],
145+
#| ?title: String
146+
#| ) -> void
142147
def initialize(file_tree:, nodes_strictnesses:, nodes_strictness_scores:, title: "Strictness Map")
143148
super(
144149
title: title,
@@ -222,7 +227,16 @@ def erb
222227
end
223228

224229
class Report < Page
225-
#: (project_name: String, palette: D3::ColorPalette, snapshots: Array[Snapshot], file_tree: FileTree, nodes_strictnesses: Hash[FileTree::Node, String?], nodes_strictness_scores: Hash[FileTree::Node, Float], ?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void
230+
#: (
231+
#| project_name: String,
232+
#| palette: D3::ColorPalette,
233+
#| snapshots: Array[Snapshot],
234+
#| file_tree: FileTree,
235+
#| nodes_strictnesses: Hash[FileTree::Node, String?],
236+
#| nodes_strictness_scores: Hash[FileTree::Node, Float],
237+
#| ?sorbet_intro_commit: String?,
238+
#| ?sorbet_intro_date: Time?
239+
#| ) -> void
226240
def initialize(
227241
project_name:,
228242
palette:,

lib/spoom/model/model.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ class Class < Namespace
129129
#: String?
130130
attr_accessor :superclass_name
131131

132-
#: (Symbol symbol, owner: Namespace?, location: Location, ?superclass_name: String?, ?comments: Array[Comment]) -> void
132+
#: (
133+
#| Symbol symbol,
134+
#| owner: Namespace?,
135+
#| location: Location,
136+
#| ?superclass_name: String?,
137+
#| ?comments: Array[Comment]
138+
#| ) -> void
133139
def initialize(symbol, owner:, location:, superclass_name: nil, comments: [])
134140
super(symbol, owner: owner, location: location, comments: comments)
135141

@@ -160,7 +166,14 @@ class Property < SymbolDef
160166
#: Array[Sig]
161167
attr_reader :sigs
162168

163-
#: (Symbol symbol, owner: Namespace?, location: Location, visibility: Visibility, ?sigs: Array[Sig], ?comments: Array[Comment]) -> void
169+
#: (
170+
#| Symbol symbol,
171+
#| owner: Namespace?,
172+
#| location: Location,
173+
#| visibility: Visibility,
174+
#| ?sigs: Array[Sig],
175+
#| ?comments: Array[Comment]
176+
#| ) -> void
164177
def initialize(symbol, owner:, location:, visibility:, sigs: [], comments: [])
165178
super(symbol, owner: owner, location: location, comments: comments)
166179

test/spoom/file_collector_test.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ def test_collect_files_with_allowed_mime_types
101101

102102
private
103103

104-
#: (Context context, ?allow_extensions: Array[String], ?allow_mime_types: Array[String], ?exclude_patterns: Array[String]) -> Array[String]
104+
#: (
105+
#| Context context,
106+
#| ?allow_extensions: Array[String],
107+
#| ?allow_mime_types: Array[String],
108+
#| ?exclude_patterns: Array[String]
109+
#| ) -> Array[String]
105110
def collect_files(context, allow_extensions: [], allow_mime_types: [], exclude_patterns: [])
106111
# Since we work in the context directory, we need to prefix the patterns with it
107112
exclude_patterns = exclude_patterns.map { |p| File.join(context.absolute_path, p) }

0 commit comments

Comments
 (0)