From 3eb90ce5ace85a7cdaca1c389e2be6b5d18450e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Mon, 9 Sep 2024 10:17:07 +0200 Subject: [PATCH] Merge change from OBS SP6 to Git For some reason the change https://github.com/yast/yast-devtools/pull/171 was submitted to SP6 without merging to the SP6 Git branch. Let's synchronize the Git version to version in OBS. --- package/yast2-devtools.changes | 13 ++++++++++--- package/yast2-devtools.spec | 2 +- ytools/y2tool/rubocop-0.71.0_yast_style.yml | 13 +++++++++++++ ytools/y2tool/rubocop-1.24.1_yast_style.yml | 19 +++++++++++++++++++ 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/package/yast2-devtools.changes b/package/yast2-devtools.changes index 9e2a2744..981acd38 100644 --- a/package/yast2-devtools.changes +++ b/package/yast2-devtools.changes @@ -1,8 +1,15 @@ ------------------------------------------------------------------- -Fri Sep 01 19:57:03 UTC 2023 - Josef Reidinger +Fri Mar 10 17:23:47 UTC 2023 - Ladislav Slezák -- Branch package for SP6 (bsc#1208913) -- 4.6.2 +- Rubocop configuration update: Disable autocorrection for the + Lint/ScriptPermission cop or disable it completely. + (related to bsc#1209094) +- 4.6.1 + +------------------------------------------------------------------- +Fri Mar 03 14:44:07 UTC 2023 - Ladislav Slezák + +- Bump version to 4.6.0 (bsc#1208913) ------------------------------------------------------------------- Fri Sep 9 08:21:11 UTC 2022 - Michal Filka diff --git a/package/yast2-devtools.spec b/package/yast2-devtools.spec index 7a0010d3..c6cc25b9 100644 --- a/package/yast2-devtools.spec +++ b/package/yast2-devtools.spec @@ -17,7 +17,7 @@ Name: yast2-devtools -Version: 4.6.2 +Version: 4.6.1 Release: 0 Summary: YaST2 - Development Tools License: GPL-2.0-or-later diff --git a/ytools/y2tool/rubocop-0.71.0_yast_style.yml b/ytools/y2tool/rubocop-0.71.0_yast_style.yml index 79ff60e6..3b050013 100644 --- a/ytools/y2tool/rubocop-0.71.0_yast_style.yml +++ b/ytools/y2tool/rubocop-0.71.0_yast_style.yml @@ -195,3 +195,16 @@ Style/TernaryParentheses: # And template version is needed if there are more params and it needs some formatting. Style/FormatStringToken: Enabled: false + +# Disable autocorrection for the Lint/ScriptPermission check. +# +# When Rubocop finds a shebang ("#!/usr/bin/env ruby") at the beginning of +# a file it checks for the executable file flag. That makes sense. +# However, the autocorrection action is to always add the exec flag to the file, +# but in some situations the correct fix is to actually remove the shebang as it +# does not make sense. For example the file just defines a class and there is +# nothing to execute). +# +# So require the developer to decide what is the correct fix. +Lint/ScriptPermission: + AutoCorrect: false diff --git a/ytools/y2tool/rubocop-1.24.1_yast_style.yml b/ytools/y2tool/rubocop-1.24.1_yast_style.yml index b5649457..0424170c 100644 --- a/ytools/y2tool/rubocop-1.24.1_yast_style.yml +++ b/ytools/y2tool/rubocop-1.24.1_yast_style.yml @@ -234,3 +234,22 @@ Metrics/BlockLength: # rspec is known as DSL with big blocks Exclude: - "**/test/**/*" + +# Disable the Lint/ScriptPermission check. +# +# When Rubocop finds a shebang ("#!/usr/bin/env ruby") at the beginning of +# a file it checks for the executable file flag. That makes sense. +# However, the autocorrection action is to always add the exec flag to the file, +# but in some situations the correct fix is to actually remove the shebang as it +# does not make sense (e.g. the file just defines a class and there is nothing +# to execute). +# +# NOTE: Ideally the check should be enabled with autocorrection disabled. But +# there is a bug in Rubocop 1.24.1 and disabled autocorrection is ignored, +# it always adds the exec flag. :-( +# +# So disable the cop completely and check how it behaves in the future Rubocop +# versions. +# +Lint/ScriptPermission: + Enabled: false