Skip to content

Commit

Permalink
Enable rubocop-on-rbs on protobuf (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss authored Jan 21, 2025
1 parent caa4553 commit 5a0b9a2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
8 changes: 8 additions & 0 deletions gems/protobuf/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_from: ../../.rubocop.yml

RBS/Layout:
Enabled: true
RBS/Lint:
Enabled: true
RBS/Style:
Enabled: true
1 change: 0 additions & 1 deletion gems/protobuf/3.10.3/_test/services.rbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Services
class UserService < Protobuf::Rpc::Service

end

class UserRequest < Protobuf::Message
Expand Down
36 changes: 18 additions & 18 deletions gems/protobuf/3.10.3/field.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ module Protobuf
# Enum collections allows receiving String, Symbol, and Integers for updates.

class FieldArray[Elem, WriteElem] < Array[Elem]
attr_reader field: untyped
attr_reader field: untyped

def initialize: (untyped field) -> void
def initialize: (untyped field) -> void

def <<: (WriteElem? val) -> self?
def <<: (WriteElem? val) -> self?

def []=: (int index, WriteElem? obj) -> WriteElem?
def []=: (int index, WriteElem? obj) -> WriteElem?

def push: (WriteElem? val) -> self?
def push: (WriteElem? val) -> self?

def replace: (Array[WriteElem] val) -> self
def replace: (Array[WriteElem] val) -> self

# Return a hash-representation of the given values for this field type.
# The value in this case would be an array.
def to_hash_value: () -> Array[untyped]
# Return a hash-representation of the given values for this field type.
# The value in this case would be an array.
def to_hash_value: () -> Array[untyped]

# Return a hash-representation of the given values for this field type
# that is safe to convert to JSON.
# The value in this case would be an array.
def to_json_hash_value: () -> Array[untyped]
# Return a hash-representation of the given values for this field type
# that is safe to convert to JSON.
# The value in this case would be an array.
def to_json_hash_value: () -> Array[untyped]

def to_s: () -> String
def to_s: () -> String

def unshift: (WriteElem? val) -> self?
def unshift: (WriteElem? val) -> self?

private
private

def normalize: (untyped value) -> untyped
def normalize: (untyped value) -> untyped

def raise_type_error: (untyped val) -> bot
def raise_type_error: (untyped val) -> bot
end

class FieldHash[Key, Value, WValue] < Hash[Key, Value]
Expand Down
2 changes: 1 addition & 1 deletion gems/protobuf/3.10.3/rpc_method.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Protobuf

attr_reader response_type: singleton(Message)

def initialize: (Symbol, singleton(Message), singleton(Message)) ?{ (instance) [self: instance] -> void} -> void
def initialize: (Symbol, singleton(Message), singleton(Message)) ?{ (instance) [self: instance] -> void } -> void
end
end
end

0 comments on commit 5a0b9a2

Please sign in to comment.