diff --git a/.rubocop.yml b/.rubocop.yml
index 778bf764f..ca633501b 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,6 +1,6 @@
# use the shared Yast defaults
inherit_from:
- - /usr/share/YaST2/data/devtools/data/rubocop-0.71.0_yast_style.yml
+ - /usr/share/YaST2/data/devtools/data/rubocop-1.24.1_yast_style.yml
# this needs more testing if we can have frozen string literals
Style/FrozenStringLiteralComment:
@@ -10,46 +10,9 @@ Naming/FileName:
Include:
- "library/*/src/lib/**/*.rb"
-# TODO: enable it, just ENOTIME
-# Offense count: 21
-Lint/Loop:
- Exclude:
- - 'src/clients/files_auto.rb'
- - 'src/clients/inst_autosetup.rb'
- - 'src/clients/inst_autosetup_upgrade.rb'
- - 'src/clients/report_auto.rb'
- - 'src/clients/software_auto.rb'
- - 'src/include/autoinstall/classes.rb'
- - 'src/include/autoinstall/dialogs.rb'
- - 'src/include/autoinstall/general_dialogs.rb'
- - 'src/include/autoinstall/script_dialogs.rb'
- - 'src/modules/Profile.rb'
- - 'src/modules/ProfileLocation.rb'
-
-# TODO: enable it, just ENOTIME
-# Offense count: 7
-Lint/ShadowingOuterLocalVariable:
- Exclude:
- - 'src/clients/inst_autoinit.rb'
- - 'src/include/autoinstall/conftree.rb'
- - 'src/include/autoinstall/general_dialogs.rb'
-
-# TODO: enable it, just ENOTIME
-# Offense count: 27
-# Configuration parameters: AllowKeywordBlockArguments.
-Lint/UnderscorePrefixedVariableName:
- Exclude:
- - 'src/clients/inst_autoconfigure.rb'
- - 'src/clients/inst_autopost.rb'
- - 'src/include/autoinstall/classes.rb'
- - 'src/include/autoinstall/conftree.rb'
- - 'src/modules/AutoInstallRules.rb'
- - 'src/modules/Profile.rb'
- - 'src/modules/Y2ModuleConfig.rb'
-
-# Offense count: 95
+# GeneralDialogs.AskDialog rules them all
Metrics/AbcSize:
- Max: 448
+ Max: 455
# Offense count: 105
# Configuration parameters: CountComments, ExcludedMethods.
@@ -70,9 +33,9 @@ Metrics/BlockNesting:
Metrics/ClassLength:
Max: 1000
-# Offense count: 82
+# GeneralDialogs.AskDialog rules them all
Metrics/CyclomaticComplexity:
- Max: 78
+ Max: 86
# Offense count: 112
# Configuration parameters: CountComments, ExcludedMethods.
@@ -82,7 +45,7 @@ Metrics/MethodLength:
# Offense count: 12
# Configuration parameters: CountComments.
Metrics/ModuleLength:
- Max: 1062
+ Max: 1063
# Offense count: 2
# Configuration parameters: CountKeywordArgs.
@@ -110,7 +73,7 @@ Naming/MethodName:
# TODO: enable it, just ENOTIME
# Offense count: 16
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
-Naming/UncommunicativeBlockParamName:
+Naming/BlockParameterName:
Exclude:
- 'src/clients/clone_system.rb'
- 'src/include/autoinstall/PartitionDialog.rb'
@@ -124,7 +87,7 @@ Naming/UncommunicativeBlockParamName:
# Offense count: 91
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db
-Naming/UncommunicativeMethodParamName:
+Naming/MethodParameterName:
Enabled: false
# Offense count: 573
diff --git a/doc/profile_conversions.md b/doc/profile_conversions.md
index 7802c82c6..c7bcf2fc4 100644
--- a/doc/profile_conversions.md
+++ b/doc/profile_conversions.md
@@ -37,7 +37,7 @@ data types to the old ones. This is useful if you want to use a new profile
in an old system (SLE15-SP2 and older). The old AutoYaST cannot read the new
data types and it would fail.
-The [`old_types.xslt`](../xslt/old_types.xslt) file converts the short
+The [old_types.xslt](../xslt/old_types.xslt) file converts the short
attributes `t="boolean"` to long attributes `config:type="boolean"`.
```shell
diff --git a/src/clients/autoinst_scripts1_finish.rb b/src/clients/autoinst_scripts1_finish.rb
index f4582f062..7ecfc31d6 100644
--- a/src/clients/autoinst_scripts1_finish.rb
+++ b/src/clients/autoinst_scripts1_finish.rb
@@ -36,7 +36,8 @@ def main
Builtins.y2debug("func=%1", @func)
Builtins.y2debug("param=%1", @param)
- if @func == "Info"
+ case @func
+ when "Info"
return {
"steps" => 1,
# progress step title
@@ -45,7 +46,7 @@ def main
),
"when" => [:autoinst, :autoupg]
}
- elsif @func == "Write"
+ when "Write"
AutoinstScripts.Write("chroot-scripts", false)
AutoInstall.Finish(Installation.destdir)
else
diff --git a/src/clients/autoinst_scripts2_finish.rb b/src/clients/autoinst_scripts2_finish.rb
index df6b80fb3..1b306399d 100644
--- a/src/clients/autoinst_scripts2_finish.rb
+++ b/src/clients/autoinst_scripts2_finish.rb
@@ -35,7 +35,8 @@ def main
Builtins.y2debug("func=%1", @func)
Builtins.y2debug("param=%1", @param)
- if @func == "Info"
+ case @func
+ when "Info"
return {
"steps" => 1,
# progress step title
@@ -44,7 +45,7 @@ def main
),
"when" => [:autoinst, :autoupg]
}
- elsif @func == "Write"
+ when "Write"
# Calling chroot scripts
AutoinstScripts.Write("chroot-scripts", true)
diff --git a/src/clients/classes_auto.rb b/src/clients/classes_auto.rb
index ca68fdee1..46d7c2480 100644
--- a/src/clients/classes_auto.rb
+++ b/src/clients/classes_auto.rb
@@ -35,7 +35,8 @@ def main
Builtins.y2debug("func=%1", @func)
Builtins.y2debug("param=%1", @param)
- if @func == "Import"
+ case @func
+ when "Import"
@ret = AutoinstClass.Import(
Convert.convert(@param, from: "list", to: "list
"
)
log.info "Profile general,mode:#{AutoinstGeneral.mode.inspect}"
@@ -193,7 +193,7 @@ def main
logStep(_("Restarting all running services"))
@cmd = "systemctl --type=service list-units | grep \" running \""
@out = Convert.to_map(SCR.Execute(path(".target.bash_output"), @cmd))
- @sl = Ops.get_string(@out, "stdout", "").split("\n").collect { |c| c.split(" ").first }
+ @sl = Ops.get_string(@out, "stdout", "").split("\n").collect { |c| c.split.first }
Builtins.y2milestone("running services \"%1\"", @sl)
# Filtering out all services which must not to be restarted
diff --git a/src/clients/inst_autopost.rb b/src/clients/inst_autopost.rb
index c9df3657b..f9cd8db06 100644
--- a/src/clients/inst_autopost.rb
+++ b/src/clients/inst_autopost.rb
@@ -125,12 +125,11 @@ def dirname(filePath)
Ops.subtract(Builtins.size(pathComponents), 1),
""
)
- ret = Builtins.substring(
+ Builtins.substring(
filePath,
0,
Ops.subtract(Builtins.size(filePath), Builtins.size(last))
)
- ret
end
end
end
diff --git a/src/clients/inst_store_upgrade_software.rb b/src/clients/inst_store_upgrade_software.rb
index 8b8c3ec19..1931bc318 100644
--- a/src/clients/inst_store_upgrade_software.rb
+++ b/src/clients/inst_store_upgrade_software.rb
@@ -18,16 +18,15 @@ def main
p.transact_by == :app_high
end
- # note: does not matter if it is installed or to be installed, the resulting
+ # NOTE: does not matter if it is installed or to be installed, the resulting
# state is the same; similar for uninstallation (valid for all packages, patterns
# and products
@patterns_to_remove = []
@patterns_to_install = @patterns.map do |p|
- if p.status == :selected ||
- p.status == :installed
+ case p.status
+ when :selected, :installed
next p.name
- elsif p.status == :removed ||
- p.status == :available
+ when :removed, :available
@patterns_to_remove << p.name
end
@@ -56,11 +55,10 @@ def main
@products_to_remove = []
@products_to_install = @products.map do |p|
- if p.status == :selected ||
- p.status == :installed
+ case p.status
+ when :selected, :installed
next p.name
- elsif p.status == :removed ||
- p.status == :available
+ when :removed, :available
@products_to_remove << p.name
end
diff --git a/src/clients/storage_auto.rb b/src/clients/storage_auto.rb
index 81f2b7009..8a8b42b88 100644
--- a/src/clients/storage_auto.rb
+++ b/src/clients/storage_auto.rb
@@ -40,7 +40,8 @@ def main
Builtins.y2debug("param=%1", @param)
# Import Data
- if @func == "Import"
+ case @func
+ when "Import"
@ret = AutoinstPartPlan.Import(
Convert.convert(@param, from: "list", to: "list