Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable rubocop-on-rbs on protobuf #776

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading