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

New rubocop (0.41.2 → 1.24.1) #603

Merged
merged 16 commits into from
Jun 4, 2024
Merged

New rubocop (0.41.2 → 1.24.1) #603

merged 16 commits into from
Jun 4, 2024

Conversation

jreidinger
Copy link
Member

@jreidinger jreidinger commented May 31, 2024

Problem

The old rubocop version used for style no longer supports new ruby (3.3 used in Tumbleweed)

Solution

Update to the latest predefined yast version of rubocop.

@coveralls
Copy link

coveralls commented May 31, 2024

Coverage Status

coverage: 83.923% (-0.2%) from 84.12%
when pulling d37285c on new_rubocop
into b0d0b5b on master.

log.info "Found obsoleted service: #{old_service}"
::Registration::SwMgmt.remove_service(old_service)
end
if old_service && !old_service.empty? && old_service != product_service.name && ::Registration::SwMgmt.service_installed?(old_service)
Copy link
Member

Choose a reason for hiding this comment

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

Is it intentional to delete the comment here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I do not see on github which comment is removed?

.rubocop.yml Outdated
@@ -73,3 +73,8 @@ Style/OptionalBooleanParameter:
# it sometimes make code harder to read
Style/GuardClause:
Enabled: false

# disable missing ending range as it is not supported in ruby 2.7
# TODO: is it bug in rubocop that with target ruby version 2.7 it stil do it?
Copy link
Member

Choose a reason for hiding this comment

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

Interesting question.
The current source for the cop thinks endless ranges should work even since Ruby 2.6:
https://github.com/rubocop/rubocop/blob/751898494b694f0520d1739b877e1add94c71366/lib/rubocop/cop/style/slicing_with_range.rb

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, it is my fault. ruby in SLE15 is 2.5 and not 2.7.

jreidinger@jreidinger:~/prace/yast/registration> ruby --version
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux-gnu]

@mvidner mvidner changed the title New rubocop New rubocop (0.41.2 → 1.24.1) May 31, 2024
Copy link
Member

@mvidner mvidner left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

@lslezak lslezak left a comment

Choose a reason for hiding this comment

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

In general LGTM, I'm just not sure about that extra multiline text indentations...

@@ -311,13 +308,10 @@ def service_for_product(product, &block)
def update_services(product_service)
old_service = product_service.obsoleted_service_name
# sanity check
if old_service && !old_service.empty? && old_service != product_service.name
# old_service comes from SCC. So it could be that we have already removed
Copy link
Member

Choose a reason for hiding this comment

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

Ah, this comment was lost...

@@ -106,7 +106,7 @@ def load_resolvable(filename)
require_relative "factories"

# force loading all files to report proper code coverage
Dir.chdir(libdir) { Dir["**/*.rb"].each { |f| require f } }
Dir.chdir(libdir) { Dir["**/*.rb"].sort.each { |f| require f } }
Copy link
Member

Choose a reason for hiding this comment

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

I think this forced loading is not needed anymore since we use the SimpleCov.track_files call above.

"but the server connection still cannot be trusted.\n\n" \
"Please fix the certificate issue manually, ensure that the server\n" \
"can be connected securely and start the YaST module again."))
"but the server connection still cannot be trusted.\n\n" \
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if I like this extra indentation for texts. It makes less space available and requires more shorter lines. 🤔

Esp. it is strange that for Hashes or named parameters it requires the opposite.

urltok: {}, destdir: "")
urlpath: "/#{name}",
localfile: path,
urltok: {}, destdir: "")
Copy link
Member

Choose a reason for hiding this comment

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

This example of an inconsistency, for multiline string it would require the extra indentation here.

@lslezak
Copy link
Member

lslezak commented Jun 3, 2024

Dropping that "require all" revealed a lot of missing require calls in the tests.
https://github.com/yast/yast-registration/actions/runs/9346186142/job/25720509001#step:5:26

@mvidner
Copy link
Member

mvidner commented Jun 3, 2024

@jreidinger @lslezak IMHO we're too strict on ourselves by removing the "require everything" bit in tests. It can wait for another housekeeping round. Or I can clean it up if you feel that now the time is right.

@jreidinger
Copy link
Member Author

@mvidner @lslezak Well, I do it this night, as I feel a bit tired to start that new fancy websocket based console on night and let it for morning. So updated and hopefully it should fix all issues.

@jreidinger
Copy link
Member Author

all is green, so ready for final blessing.

Copy link
Member

@lslezak lslezak left a comment

Choose a reason for hiding this comment

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

LGTM

@jreidinger jreidinger merged commit 4f42310 into master Jun 4, 2024
12 checks passed
@jreidinger jreidinger deleted the new_rubocop branch June 4, 2024 07:41
@yast-bot
Copy link
Contributor

yast-bot commented Jun 4, 2024

✔️ Internal Jenkins job #118 successfully finished
✔️ Created OBS submit request #1178458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants