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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Naming/PredicateName:
Enabled: false

Naming/MethodParameterName:
Enabled: false
Style/SlicingWithRange:Enabled: false

# Let lslezak decide what to do with it. In general jreidinger does not see it as such big violence of style
Style/StructInheritance:
Expand All @@ -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]

Style/SlicingWithRange:
Enabled: false
2 changes: 1 addition & 1 deletion src/lib/registration/ssl_certificate_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def summary(small_space: false)
sha256 = certificate.fingerprint(Fingerprint::SHA256).value
summary += if small_space
# split the long SHA256 digest to two lines in small text mode UI
INDENT + sha256[0..59] + "\n" + INDENT + sha256[60..]
INDENT + sha256[0..59] + "\n" + INDENT + sha256[60..-1]
else
INDENT + sha256
end
Expand Down
2 changes: 1 addition & 1 deletion src/lib/registration/ui/addon_reg_codes_dialog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def reg_code_boxes
box1 = addon_regcode_items(display_addons[0..half - 1])
box2 = HBox(
HSpacing(2),
addon_regcode_items(display_addons[half..])
addon_regcode_items(display_addons[half..-1])
)
else
box1 = addon_regcode_items(addons_with_regcode)
Expand Down
Loading