Skip to content

Commit 0925835

Browse files
chore: ignore some spurious linter warnings and formatting changes (#168)
1 parent 421c2f7 commit 0925835

File tree

9 files changed

+65
-5
lines changed

9 files changed

+65
-5
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ AllCops:
1010
SuggestExtensions: false
1111
TargetRubyVersion: 3.1.0
1212

13+
# Whether MFA is required or not should be left to the token configuration
14+
Gemspec/RequireMFA:
15+
Enabled: false
16+
1317
# Don't require this extra line break, it can be excessive.
1418
Layout/EmptyLineAfterGuardClause:
1519
Enabled: false

lib/orb/base_page.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ module Orb
2828
# top_levels => Array
2929
# ```
3030
module BasePage
31+
# rubocop:disable Lint/UnusedMethodArgument
32+
3133
# @return [Boolean]
3234
def next_page? = (raise NotImplementedError)
3335

@@ -56,5 +58,7 @@ def initialize(client:, req:, headers:, page_data:)
5658
@req = req
5759
super()
5860
end
61+
62+
# rubocop:enable Lint/UnusedMethodArgument
5963
end
6064
end

lib/orb/page.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def auto_paging_each(&blk)
9191

9292
# @return [String]
9393
def inspect
94+
# rubocop:disable Layout/LineLength
9495
"#<#{self.class}:0x#{object_id.to_s(16)} data=#{data.inspect} pagination_metadata=#{pagination_metadata.inspect}>"
96+
# rubocop:enable Layout/LineLength
9597
end
9698

9799
class PaginationMetadata < Orb::BaseModel

lib/orb/util.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ def string_io(&blk)
452452
end
453453

454454
class << self
455+
# rubocop:disable Naming/MethodParameterName
455456
# @api private
456457
#
457458
# @param y [Enumerator::Yielder]
@@ -489,6 +490,7 @@ class << self
489490
end
490491
y << "\r\n"
491492
end
493+
# rubocop:enable Naming/MethodParameterName
492494

493495
# @api private
494496
#

orb.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ Gem::Specification.new do |s|
1515
s.homepage = "https://gemdocs.org/gems/orb"
1616
s.metadata["homepage_uri"] = s.homepage
1717
s.metadata["source_code_uri"] = "https://github.com/orbcorp/orb-ruby"
18-
s.metadata["rubygems_mfa_required"] = "false"
18+
s.metadata["rubygems_mfa_required"] = false.to_s
1919
end

rbi/lib/orb/base_model.rbi

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,20 @@ module Orb
310310

311311
Elem = type_member(:out)
312312

313+
sig(:final) do
314+
params(
315+
type_info: T.any(
316+
T::Hash[Symbol, T.anything],
317+
T.proc.returns(Orb::Converter::Input),
318+
Orb::Converter::Input
319+
),
320+
spec: T::Hash[Symbol, T.anything]
321+
)
322+
.returns(T.attached_class)
323+
end
324+
def self.[](type_info, spec = {})
325+
end
326+
313327
sig(:final) { params(other: T.anything).returns(T::Boolean) }
314328
def ===(other)
315329
end
@@ -360,9 +374,9 @@ module Orb
360374
),
361375
spec: T::Hash[Symbol, T.anything]
362376
)
363-
.returns(T.attached_class)
377+
.void
364378
end
365-
def self.new(type_info, spec = {})
379+
def initialize(type_info, spec = {})
366380
end
367381
end
368382

@@ -377,6 +391,20 @@ module Orb
377391

378392
Elem = type_member(:out)
379393

394+
sig(:final) do
395+
params(
396+
type_info: T.any(
397+
T::Hash[Symbol, T.anything],
398+
T.proc.returns(Orb::Converter::Input),
399+
Orb::Converter::Input
400+
),
401+
spec: T::Hash[Symbol, T.anything]
402+
)
403+
.returns(T.attached_class)
404+
end
405+
def self.[](type_info, spec = {})
406+
end
407+
380408
sig(:final) { params(other: T.anything).returns(T::Boolean) }
381409
def ===(other)
382410
end
@@ -427,9 +455,9 @@ module Orb
427455
),
428456
spec: T::Hash[Symbol, T.anything]
429457
)
430-
.returns(T.attached_class)
458+
.void
431459
end
432-
def self.new(type_info, spec = {})
460+
def initialize(type_info, spec = {})
433461
end
434462
end
435463

rbi/lib/orb/page.rbi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ module Orb
2222
def pagination_metadata=(_)
2323
end
2424

25+
sig { returns(String) }
26+
def inspect
27+
end
28+
2529
class PaginationMetadata < Orb::BaseModel
2630
sig { returns(T::Boolean) }
2731
def has_more

sig/orb/base_model.rbs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ module Orb
118118
class ArrayOf[Elem]
119119
include Orb::Converter
120120

121+
def self.[]: (
122+
::Hash[Symbol, top]
123+
| ^-> Orb::Converter::input
124+
| Orb::Converter::input type_info,
125+
?::Hash[Symbol, top] spec
126+
) -> instance
127+
121128
def ===: (top other) -> bool
122129

123130
def ==: (top other) -> bool
@@ -143,6 +150,13 @@ module Orb
143150
class HashOf[Elem]
144151
include Orb::Converter
145152

153+
def self.[]: (
154+
::Hash[Symbol, top]
155+
| ^-> Orb::Converter::input
156+
| Orb::Converter::input type_info,
157+
?::Hash[Symbol, top] spec
158+
) -> instance
159+
146160
def ===: (top other) -> bool
147161

148162
def ==: (top other) -> bool

sig/orb/page.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module Orb
66

77
attr_accessor pagination_metadata: PaginationMetadata
88

9+
def inspect: -> String
10+
911
type pagination_metadata = { has_more: bool, next_cursor: String? }
1012
class PaginationMetadata < Orb::BaseModel
1113
attr_accessor has_more: bool

0 commit comments

Comments
 (0)