Skip to content

Commit

Permalink
rubocop: enable Style/NonNilCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 28, 2023
1 parent 9ba3cae commit 5863359
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
9 changes: 0 additions & 9 deletions .rubocop.yml
Expand Up @@ -152,12 +152,3 @@ Style/NilComparison:
Exclude:
- 'src/clients/security.rb'
- 'src/include/security/routines.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: IncludeSemanticChanges.
Style/NonNilCheck:
Exclude:
- 'src/include/security/dialogs.rb'
- 'src/include/security/routines.rb'
- 'src/modules/Security.rb'
6 changes: 3 additions & 3 deletions src/include/security/dialogs.rb
Expand Up @@ -337,7 +337,7 @@ def DisplayHelpPopup(help_id)
when "MANDATORY_SERVICES"
missing = Security.MissingMandatoryServices

if missing != nil && missing != []
if !missing.nil? && missing != []
srvs = ""

Builtins.foreach(missing) do |l|
Expand All @@ -356,7 +356,7 @@ def DisplayHelpPopup(help_id)
when "EXTRA_SERVICES"
extra = Security.ExtraServices

if extra != nil && extra != []
if !extra.nil? && extra != []
srvs = Builtins.mergestring(extra, "<BR>")
help +=
_("<P>These extra services are enabled:<BR><B>%s</B></P>") % srvs
Expand All @@ -366,7 +366,7 @@ def DisplayHelpPopup(help_id)
end
end

if help != nil && help != ""
if !help.nil? && help != ""
Popup.LongText(
Ops.get(@label_mapping, help_id, _("Description")),
RichText(help),
Expand Down
2 changes: 1 addition & 1 deletion src/include/security/routines.rb
Expand Up @@ -165,7 +165,7 @@ def widget2settings(id)
new = nil
end

if new != nil && Ops.get(Security.Settings, id, "") != new
if !new.nil? && Ops.get(Security.Settings, id, "") != new
Builtins.y2milestone(
"Setting modified (%1): %2 -> %3)",
id,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Security.rb
Expand Up @@ -288,7 +288,7 @@ def PollAbort
# Abort function
# @return blah blah lahjk
def Abort
return Builtins.eval(@AbortFunction) == true if @AbortFunction != nil
return Builtins.eval(@AbortFunction) == true if !@AbortFunction.nil?

false
end
Expand Down

0 comments on commit 5863359

Please sign in to comment.