Skip to content

Commit 0e7dd84

Browse files
chore: fix misc linting / minor issues
1 parent 786d1e3 commit 0e7dd84

File tree

9 files changed

+17
-10
lines changed

9 files changed

+17
-10
lines changed

.rubocop.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AllCops:
88
- "bin/*"
99
NewCops: enable
1010
SuggestExtensions: false
11-
TargetRubyVersion: 3.1.0
11+
TargetRubyVersion: 3.2.0
1212

1313
# Whether MFA is required or not should be left to the token configuration.
1414
Gemspec/RequireMFA:
@@ -112,6 +112,8 @@ Metrics/AbcSize:
112112
Metrics/BlockLength:
113113
AllowedPatterns:
114114
- assert_pattern
115+
- type_alias
116+
- define_sorbet_constant!
115117
Exclude:
116118
- "**/*.rbi"
117119

@@ -182,6 +184,9 @@ Style/ClassAndModuleChildren:
182184
Exclude:
183185
- "test/**/*"
184186

187+
Style/CommentAnnotation:
188+
Enabled: false
189+
185190
# We should go back and add these docs, but ignore for now.
186191
Style/Documentation:
187192
Enabled: false

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ desc("Lint `*.rb(i)`")
4141
multitask(:"lint:rubocop") do
4242
find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0]
4343

44-
rubocop = %w[rubocop --fail-level E]
44+
rubocop = %w[rubocop]
4545
rubocop += %w[--format github] if ENV.key?("CI")
4646

4747
# some lines cannot be shortened

lib/orb.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
# Standard libraries.
4+
# rubocop:disable Lint/RedundantRequireStatement
45
require "English"
56
require "cgi"
67
require "date"
@@ -15,6 +16,7 @@
1516
require "stringio"
1617
require "time"
1718
require "uri"
19+
# rubocop:enable Lint/RedundantRequireStatement
1820

1921
# We already ship the preferred sorbet manifests in the package itself.
2022
# `tapioca` currently does not offer us a way to opt out of unnecessary compilation.

lib/orb/errors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class APIStatusError < Orb::Errors::APIError
9999
# @param response [nil]
100100
# @param message [String, nil]
101101
#
102-
# @return [Orb::Errors::APIStatusError]
102+
# @return [self]
103103
def self.for(url:, status:, body:, request:, response:, message: nil)
104104
key = Orb::Internal::Util.dig(body, :type)
105105
kwargs = {

rbi/orb/errors.rbi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module Orb
104104
request: NilClass,
105105
response: NilClass,
106106
message: T.nilable(String)
107-
).returns(T.self_type)
107+
).returns(T.attached_class)
108108
end
109109
def self.for(url:, status:, body:, request:, response:, message: nil)
110110
end

sig/orb/internal/type/array_of.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Orb
99
| ^-> Orb::Internal::Type::Converter::input
1010
| Orb::Internal::Type::Converter::input type_info,
1111
?::Hash[Symbol, top] spec
12-
) -> self
12+
) -> instance
1313

1414
def ===: (top other) -> bool
1515

sig/orb/internal/type/base_model.rbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ module Orb
6161
def self.coerce: (
6262
Orb::Internal::Type::BaseModel | ::Hash[top, top] | top value,
6363
state: Orb::Internal::Type::Converter::coerce_state
64-
) -> (self | top)
64+
) -> (instance | top)
6565

6666
def self.dump: (
67-
self | top value,
67+
instance | top value,
6868
state: Orb::Internal::Type::Converter::dump_state
6969
) -> (::Hash[top, top] | top)
7070

@@ -84,7 +84,7 @@ module Orb
8484

8585
def to_yaml: (*top a) -> String
8686

87-
def initialize: (?::Hash[Symbol, top] | self data) -> void
87+
def initialize: (?::Hash[Symbol, top] | instance data) -> void
8888

8989
def self.inspect: (?depth: Integer) -> String
9090

sig/orb/internal/type/base_page.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Orb
44
module BasePage[Elem]
55
def next_page?: -> bool
66

7-
def next_page: -> self
7+
def next_page: -> instance
88

99
def auto_paging_each: { (Elem arg0) -> void } -> void
1010

sig/orb/internal/type/hash_of.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Orb
99
| ^-> Orb::Internal::Type::Converter::input
1010
| Orb::Internal::Type::Converter::input type_info,
1111
?::Hash[Symbol, top] spec
12-
) -> self
12+
) -> instance
1313

1414
def ===: (top other) -> bool
1515

0 commit comments

Comments
 (0)