-
Notifications
You must be signed in to change notification settings - Fork 22
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 #660
New rubocop #660
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.
Looks OK to me
src/lib/bootloader/grub2base.rb
Outdated
"<a href=\"enable_secure_boot\">(#{_("enable")})</a>" | ||
end | ||
|
||
"#{_("Secure Boot:")} #{secure_boot ? _("enabled") : _("disabled")} #{link}" |
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.
NP: this pattern is repeated several times in the code, what about defining some helper like
def status_string(status)
status ? _("enabled") : _("disabled")
end
# and then use in
"#{_("Secure Boot:")} #{status_string(secure_boot)} #{link}"
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.
yeap, also notice it.
test/grub2pwd_test.rb
Outdated
@@ -5,6 +5,23 @@ | |||
|
|||
require "bootloader/grub2pwd" | |||
|
|||
ENCRYPTED_PASSWORD = "grub.pbkdf2.sha512.10000.774E325959D6D7BCFB7384A0245674D83D0D540A89C02FEA81E35489F8DE7ADFD93988190AD9857A0FFF363825DDF97C8F4E658D8CC49FC4A22C053B08AB3EFE.6FB19FF26FD03D85C40A33D8BA7C04E72EDE3DD5D7080C177553A4FED370F71C579AF0B15B3B93ECECEA355469A4B6D0560BFB53ED35DDA0B80F5363BFBD54E4" |
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.
Too long line?
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.
strange that it does not complain. Not sure why
src/lib/bootloader/sysconfig.rb
Outdated
@@ -35,14 +35,14 @@ def initialize(bootloader: nil, secure_boot: false, trusted_boot: false, update_ | |||
end | |||
|
|||
def self.from_system | |||
bootloader = Yast::SCR.Read(AGENT_PATH + "LOADER_TYPE") | |||
bootloader = Yast::SCR.Read("#{AGENT_PATH}LOADER_TYPE") |
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.
and here is wrong auto correct. Because AGENT_PATH is not string, but Yast::Path, then result is different.
It LGTM but maybe @dgdavid found something I overlooked 😜 |
if status | ||
_("enabled") | ||
else | ||
_("disabled") | ||
end |
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.
NP: I'd use ternary operator here.
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.
LGTM
✔️ Internal Jenkins job #67 successfully finished |
✔️ Public Jenkins job #104 successfully finished |
draft for review of changes done in new rubocop that works with ruby 3.1