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

chore(deps-dev): update rubocop to ~> 1.58.0 in multiple gems #756

Merged
merged 4 commits into from
Dec 7, 2023

Conversation

robbkidd
Copy link
Member

@robbkidd robbkidd commented Dec 7, 2023

Update gemspecs

When dependabot is piecemealing a monorepo of gems (#748, #749, #750. #751, #752. #753, #754), go Old School:

git ls-files \*.gemspec \
  | xargs \
    sed -i '' \
        -E "s/'rubocop', '~> [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+'/'rubocop', '~> 1.54.1'/"

Rubocop Appeasements

Lint/RedundantSafeNavigation

Redundant safe navigation with default literal detected.
  prefix = endpoint.routes.first.options[:prefix]&.to_s || ''
                                                 ^^^^^^^^^^^^

OK. We can stop at safely navigating the string coercion without supplying a default because paths.reject{} below filters nils.

Style/RedundantReturn

Redundant return detected.
  return "HTTP #{request_method} #{request_path} miniswan"
  ^^^^^^

Sure.

Style/RedundantParentheses

Don't use parentheses around a logical expression.
      (!gem_version.nil? && gem_version >= MINIMUM_VERSION)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

OK.

  Redundant safe navigation with default literal detected.
    prefix = endpoint.routes.first.options[:prefix]&.to_s || ''
                                                   ^^^^^^^^^^^^

OK. We can stop at safely navigating the string coersion without
supplying a default because paths.reject{} below filters nils.
  Redundant return detected.
    return "HTTP #{request_method} #{request_path} miniswan"
    ^^^^^^

Sure.
  Don't use parentheses around a logical expression.
        (!gem_version.nil? && gem_version >= MINIMUM_VERSION)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

OK.
@robbkidd robbkidd requested a review from a team December 7, 2023 22:45
@robbkidd robbkidd added the dependencies Pull requests that update a dependency file label Dec 7, 2023
@robbkidd robbkidd self-assigned this Dec 7, 2023
@robbkidd robbkidd added the ruby Pull requests that update Ruby code label Dec 7, 2023
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@arielvalentin arielvalentin merged commit 9dbea18 into open-telemetry:main Dec 7, 2023
47 checks passed
Copy link
Member Author

@robbkidd robbkidd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving the notes about code changes inline for easier review.


Update: ... and then it merged before I added these notes!

It happened so fast!

version = endpoint.routes.first.options[:version] || ''
prefix = endpoint.routes.first.options[:prefix]&.to_s || ''
version = endpoint.routes.first.options[:version]&.to_s
prefix = endpoint.routes.first.options[:prefix]&.to_s
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can stop at safely navigating the string coercion without supplying a default because parts.reject{} below filters nils.

@@ -22,7 +22,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
end

compatible do
(!gem_version.nil? && gem_version >= MINIMUM_VERSION)
!gem_version.nil? && gem_version >= MINIMUM_VERSION
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appease Rubocop: Style/RedundantParentheses

Don't use parentheses around a logical expression.
     (!gem_version.nil? && gem_version >= MINIMUM_VERSION)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

OK.

@@ -128,7 +128,7 @@
let(:span_name_formatter) do
# demonstrate simple addition of path and string to span name:
lambda { |request_method, request_path|
return "HTTP #{request_method} #{request_path} miniswan"
"HTTP #{request_method} #{request_path} miniswan"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appease Rubocop: Style/RedundantReturn

Redundant return detected.
  return "HTTP #{request_method} #{request_path} miniswan"
  ^^^^^^

Sure.

@robbkidd robbkidd deleted the update-rubocop-in-bulk branch December 7, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants