From 3b6fb0d83ff79800819710da9d092270d1455aa1 Mon Sep 17 00:00:00 2001 From: ksss Date: Tue, 21 Jan 2025 11:22:54 +0900 Subject: [PATCH] Enable rubocop-on-rbs on protobuf --- gems/protobuf/.rubocop.yml | 8 ++++++ gems/protobuf/3.10.3/_test/services.rbs | 1 - gems/protobuf/3.10.3/field.rbs | 36 ++++++++++++------------- gems/protobuf/3.10.3/rpc_method.rbs | 2 +- 4 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 gems/protobuf/.rubocop.yml diff --git a/gems/protobuf/.rubocop.yml b/gems/protobuf/.rubocop.yml new file mode 100644 index 000000000..74cedeae6 --- /dev/null +++ b/gems/protobuf/.rubocop.yml @@ -0,0 +1,8 @@ +inherit_from: ../../.rubocop.yml + +RBS/Layout: + Enabled: true +RBS/Lint: + Enabled: true +RBS/Style: + Enabled: true diff --git a/gems/protobuf/3.10.3/_test/services.rbs b/gems/protobuf/3.10.3/_test/services.rbs index a7605579e..88214350e 100644 --- a/gems/protobuf/3.10.3/_test/services.rbs +++ b/gems/protobuf/3.10.3/_test/services.rbs @@ -1,6 +1,5 @@ module Services class UserService < Protobuf::Rpc::Service - end class UserRequest < Protobuf::Message diff --git a/gems/protobuf/3.10.3/field.rbs b/gems/protobuf/3.10.3/field.rbs index 54c4cf3ce..7d47861ff 100644 --- a/gems/protobuf/3.10.3/field.rbs +++ b/gems/protobuf/3.10.3/field.rbs @@ -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] diff --git a/gems/protobuf/3.10.3/rpc_method.rbs b/gems/protobuf/3.10.3/rpc_method.rbs index 25de1a9fc..f1e674890 100644 --- a/gems/protobuf/3.10.3/rpc_method.rbs +++ b/gems/protobuf/3.10.3/rpc_method.rbs @@ -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