automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: silence Shellcheck warning


From: Jacob Bachmeyer
Subject: Re: PATCH: silence Shellcheck warning
Date: Tue, 18 Jan 2022 19:37:27 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0

Ben Elliston wrote:
On Tue, Jan 18, 2022 at 04:18:52AM -0500, Mike Frysinger wrote:

that said, automake targets lower than POSIX, so i agree that we
should leave it be for automake specifically.  feel like posting a
patch to suppress this particular check in lib/missing instead ?

If it's welcome, sure. Some people are opposed to littering pragmas
through source files to disable linters that they think do more harm
than good.

While I agree that Shellcheck's value is questionable, for the issues here there is no need to litter the file with pragmas. Shellcheck will consider a pragma before the first executable line in the file to apply to the entire file; I used this when reverting $() to backticks in config.guess and have included the relevant excerpt below; the"shellcheck disable" line would similarly apply to missing but the rationale would need to be revised to explain the different issues.

8<------
diff --git a/config.guess b/config.guess
index d2bdee7..4bc8157 100755
--- a/config.guess
+++ b/config.guess
@@ -2,6 +2,8 @@
# Attempt to guess a canonical system name.
#   Copyright 1992-2021 Free Software Foundation, Inc.

+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
timestamp='2021-05-24'

# This file is free software; you can redistribute it and/or modify it
@@ -32,6 +34,14 @@ timestamp='2021-05-24'
# Please send patches to <config-patches@gnu.org>.


+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX.  However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
+
me=$(echo "$0" | sed -e 's,.*/,,')

usage="\
8<------



-- Jacob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]