From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4C850159C9C for ; Sun, 11 Aug 2024 10:11:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A19F2BC101; Sun, 11 Aug 2024 10:11:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CA9CA2BC101 for ; Sun, 11 Aug 2024 10:11:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D3EB134311E for ; Sun, 11 Aug 2024 10:11:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 529691EF4 for ; Sun, 11 Aug 2024 10:11:11 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1723371065.8f708ef54a07f200b308f82fd64c2c87f5e89b11.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: /, functions/ X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh functions/experimental.sh functions/rc.sh X-VCS-Directories: / functions/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 8f708ef54a07f200b308f82fd64c2c87f5e89b11 X-VCS-Branch: master Date: Sun, 11 Aug 2024 10:11:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1a55cd05-12ed-4c26-9c62-46c5a6106cd6 X-Archives-Hash: 34818cda8de66784f7167a1ce5a9bb1e commit: 8f708ef54a07f200b308f82fd64c2c87f5e89b11 Author: Kerin Millar plushkava net> AuthorDate: Sat Aug 10 06:57:17 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Aug 11 10:11:05 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=8f708ef5 Remedy false positives in categories SC2034 and SC2154 Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> functions.sh | 5 ----- functions/experimental.sh | 1 + functions/rc.sh | 8 ++++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/functions.sh b/functions.sh index eff7f5f..38eef62 100644 --- a/functions.sh +++ b/functions.sh @@ -958,11 +958,6 @@ if [ ! "${genfun_basedir+set}" ]; then genfun_basedir=${genfun_prefix}/lib/gentoo fi -# Assign the LF ('\n') character for later expansion. POSIX-1.2024 permits $'\n' -# but it may take years for it to be commonly implemented. -genfun_newline=' -' - # The GENFUN_MODULES variable acts as a means of selecting modules, which are # merely optional collections of functions. If unset then set it now. if [ ! "${GENFUN_MODULES+set}" ]; then diff --git a/functions/experimental.sh b/functions/experimental.sh index 0ca9904..7c2fb25 100644 --- a/functions/experimental.sh +++ b/functions/experimental.sh @@ -168,6 +168,7 @@ str_between() else set -- "$2" "$1" "$3" i=0 + # shellcheck disable=2034 printf '%s\n' "$@" | sort | while IFS= read -r line; do diff --git a/functions/rc.sh b/functions/rc.sh index 4eff3c8..101b99e 100644 --- a/functions/rc.sh +++ b/functions/rc.sh @@ -347,6 +347,7 @@ _eend() "${efunc}" "${msg}" fi # Generate an indicator for ebegin's unsuccessful conclusion. + # shellcheck disable=2154 if _update_tty_level <&1; [ "${genfun_tty}" -eq 0 ]; then msg="[ !! ]" else @@ -356,6 +357,7 @@ _eend() return "${retval}" else # Generate an indicator for ebegin's successful conclusion. + # shellcheck disable=2154 if _update_tty_level <&1; [ "${genfun_tty}" -eq 0 ]; then msg="[ ok ]" else @@ -367,6 +369,7 @@ _eend() # Save the cursor position with DECSC, move it up by one line # with CUU, position it horizontally with CHA, print the # indicator, then restore the cursor position with DECRC. + # shellcheck disable=2154 col=$(( genfun_cols > 6 ? genfun_cols - 6 : 1 )) printf '\0337\033[1A\033[%dG %s\0338' "$(( col + genfun_offset ))" "${msg}" else @@ -484,5 +487,10 @@ else genfun_offset=0 fi +# Assign the LF ('\n') character for later expansion. POSIX-1.2024 permits $'\n' +# but it may take years for it to be commonly implemented. +genfun_newline=' +' + # shellcheck disable=2034 RC_GOT_FUNCTIONS=yes