Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Rubocop offenses for top-level API file #1536

@geigerj

Description

@geigerj

Context

googleapis/google-cloud-ruby#1702

What

Fix style-guide violations:

Offenses:



lib/google/cloud/video_intelligence.rb:54:81: C: Line is too long. [95/80]

      FILE_DIR = File.realdirpath(Pathname.new(__FILE__).join("..").join("video_intelligence"))

                                                                                ^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:57:9: C: Align the operands of an expression in an assignment spanning multiple lines.

        .select {|file| File.directory?(file)}

        ^^^^^^^

lib/google/cloud/video_intelligence.rb:57:17: C: Space between { and | missing.

        .select {|file| File.directory?(file)}

                ^^

lib/google/cloud/video_intelligence.rb:57:46: C: Space missing inside }.

        .select {|file| File.directory?(file)}

                                             ^

lib/google/cloud/video_intelligence.rb:58:9: C: Align the operands of an expression in an assignment spanning multiple lines.

        .select {|dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir))}

        ^^^^^^^

lib/google/cloud/video_intelligence.rb:58:17: C: Space between { and | missing.

        .select {|dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir))}

                ^^

lib/google/cloud/video_intelligence.rb:58:78: C: Space missing inside }.

        .select {|dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir))}

                                                                             ^

lib/google/cloud/video_intelligence.rb:59:9: C: Align the operands of an expression in an assignment spanning multiple lines.

        .select {|dir| File.exist?(dir + ".rb")}

        ^^^^^^^

lib/google/cloud/video_intelligence.rb:59:17: C: Space between { and | missing.

        .select {|dir| File.exist?(dir + ".rb")}

                ^^

lib/google/cloud/video_intelligence.rb:59:48: C: Space missing inside }.

        .select {|dir| File.exist?(dir + ".rb")}

                                               ^

lib/google/cloud/video_intelligence.rb:60:9: C: Align the operands of an expression in an assignment spanning multiple lines.

        .map {|dir| File.basename(dir)}

        ^^^^

lib/google/cloud/video_intelligence.rb:60:14: C: Space between { and | missing.

        .map {|dir| File.basename(dir)}

             ^^

lib/google/cloud/video_intelligence.rb:60:39: C: Space missing inside }.

        .map {|dir| File.basename(dir)}

                                      ^

lib/google/cloud/video_intelligence.rb:69:81: C: Line is too long. [109/80]

      #   [Google::Gax::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]

                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:70:81: C: Line is too long. [95/80]

      #   Provides the means for authenticating requests made by the client. This parameter can

                                                                                ^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:72:81: C: Line is too long. [91/80]

      #   A `Google::Gax::Credentials` uses a the properties of its represented keyfile for

                                                                                ^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:74:81: C: Line is too long. [98/80]

      #   A `String` will be treated as the path to the keyfile to be used for the construction of

                                                                                ^^^^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:76:81: C: Line is too long. [98/80]

      #   A `Hash` will be treated as the contents of a keyfile to be used for the construction of

                                                                                ^^^^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:79:81: C: Line is too long. [103/80]

      #   A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials

                                                                                ^^^^^^^^^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:80:81: C: Line is too long. [81/80]

      #   should already be composed with a `GRPC::Core::CallCredentials` object.

                                                                                ^

lib/google/cloud/video_intelligence.rb:81:81: C: Line is too long. [96/80]

      #   A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the

                                                                                ^^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:93:19: C: Use def without parentheses.

      def self.new(*args, version: :v1beta2, **kwargs)

                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:95:11: C: Use fail instead of raise to signal exceptions.

          raise "The version: #{version} is not available. The available versions " \

          ^^^^^

lib/google/cloud/video_intelligence.rb:95:81: C: Line is too long. [85/80]

          raise "The version: #{version} is not available. The available versions " \

                                                                                ^^^^^

lib/google/cloud/video_intelligence.rb:96:46: C: Prefer single-quoted strings inside interpolations.

            "are: [#{AVAILABLE_VERSIONS.join(", ")}]"

                                             ^^^^

lib/google/cloud/video_intelligence.rb:101:11: C: Align the operands of an expression in an assignment spanning multiple lines.

          .constants

          ^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:102:11: C: Align the operands of an expression in an assignment spanning multiple lines.

          .select {|sym| sym.to_s.downcase == version.to_s.downcase}

          ^^^^^^^

lib/google/cloud/video_intelligence.rb:102:12: C: Use find instead of select.first.

          .select {|sym| sym.to_s.downcase == version.to_s.downcase}

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

lib/google/cloud/video_intelligence.rb:102:19: C: Space between { and | missing.

          .select {|sym| sym.to_s.downcase == version.to_s.downcase}

                  ^^

lib/google/cloud/video_intelligence.rb:102:68: C: Space missing inside }.

          .select {|sym| sym.to_s.downcase == version.to_s.downcase}

                                                                   ^

lib/google/cloud/video_intelligence.rb:103:11: C: Align the operands of an expression in an assignment spanning multiple lines.

          .first

          ^^^^^^

lib/google/cloud/video_intelligence.rb:104:81: C: Line is too long. [87/80]

        Google::Cloud::VideoIntelligence.const_get(version_module).new(*args, **kwargs)

                                                                                ^^^^^^^

lib/google/cloud/video_intelligence.rb:108:4: C: Final newline missing.

end

   



2 files inspected, 33 offenses detected

Metadata

Metadata

Assignees

Labels

lang: rubyIssues specific to Ruby.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions