-
Notifications
You must be signed in to change notification settings - Fork 231
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
Update rubocop namespaces for 0.78.x #1096
Update rubocop namespaces for 0.78.x #1096
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version of rubocop for all of our instrumentations is constrained to bug fix releases of 0.73.x
In that version LineLength
is still under metrics https://github.com/rubocop/rubocop/blob/v0.73.0/lib/rubocop/cop/metrics/line_length.rb
You would would have to upgrade to everything to v0.78.0 or newer in order for us to accept this change.
https://github.com/rubocop/rubocop/blob/v0.78.0/lib/rubocop/cop/layout/line_length.rb
3635ad3
to
2117d40
Compare
Ah thank you for the explanation! I'll work on changing my rubocop version in the meantime so I can be consistent :) I wanted to try to upgrade it! So I tried to upgrade to However, I found that there were a lot of lint issues issues it found, most of which could be "safely" corrected. I did run the auto corrector on my local machine but I'm worried this would be pretty hard to review and touch a lot of the git history:
Even with these changes there are still 177 "unsafe" changes, and 164 changes that can't automatically be fixed:
Let me know how the SIG handles upgrades like these? Or if not it's fine to close this PR :) |
😩 that seems like a lot of changes. We have not gone through the process of upgrading rubocop yet and I do not know the history of selecting 0.73 version for this project so I think we need to gain some insights from @open-telemetry/ruby-maintainers. What concerns me is that there are other linters that were relocated/renamed and are now reporting violations of things we purposely have ignored. I am also unclear as to what happens if a cop is renamed or deprecated. Will it fail? |
@arielvalentin So the history... old versions of rubocop (before sometime in the 0.80s or something around there) would add—and automatically enable—new checks on every minor version, which would effectively be a breaking change because it would fail for things that didn't fail before. As a result, we pinned rubocop to a minor release, with the idea that we'd periodically update it, and each time we'd just go through the exercise of updating a bunch of code in the process to conform. 0.73 must simply have been the last time we did that, 2 or 3 years ago. Of course, at some point later, the rubocop maintainers realized this was a problem, and reworked their configs so that new checks were disabled by default. So now, if we update rubocop to something relatively recent (definitely 1.0, and I think some minor 0.x versions) we shouldn't run into this issue anymore and we can to float to the latest minor release. But that will, of course, require us to incur the one time cost of updating a lot of code to conform to newer lint checks. I do think we need to do this, because my understanding is that older versions of rubocop have issues with Ruby 3.0 and 3.1. |
@dazuma thank you for the detailed history there. That was helpful! So it does indeed sound like we want to upgrade to the most recent version if possible. @NathanielRN do you have the cycles (and patience) to help us with this? |
I wouldn't mind helping! 🙂 But I also wrote my first line of Ruby ever this week 😅 If the task is just to do those 177 + 164 lint errors I could go ahead and try, but like I said it would probably be a change that needs to be reviewed. |
Learn Ruby the Hard Way ™️ 😂 |
Hello, and thank you for your contribution! We recently split Ruby instrumentation out into the This PR is related to instrumentation, so we'll need you to re-open it against To do that, you can:
Sorry again for the inconvenience, and thank you for contributing! |
Description
I was using VSCode and formatting with the
rubocop
extension when I got a warning for the namespace of theinstrumentation/.rubocop-examples.yml
.I looked at this issue comment and found that it should be
Layout/LineLength
in that file. Updated it in this PR to make the warning go away.