🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #6884

Bug#1155004: lintian: Please use shellcheck to check for bashisms

#6884
From: Nilesh Patra
Date: Mon, 30 Nov 2026 15:50
38 lines
3739 bytes

On 23/11/26 7:00 pm, Benjamin Drung wrote:
> Package: lintian
> Version: 2.144.0
> Severity: wishlist
> X-Debbugs-Cc: bdrung@debian.org
> 
> Dear Maintainer,
> 
> I have seen several false positives for the bashisms checks, for
> example:
> 
> * bash-term-in-posix-shell false positive, triggers on "function" in an
>   embedded awk script (bug #1029223)
> * bash-term-in-posix-shell false positives for dracut (#1155003)
> 
> There is a tool that parses shell scripts and is good at detecting
> script problems including bashisms: shellcheck
> 
> Please use shellcheck for bash-term-in-posix-shell and chown-with-dot.
> It can produce a JSON output that lintian can use. shellcheck can take
> --rcfile to specify a config. In this config, lintian could turn on the
> shellcheck checks about bashisms.

I initially thought if it is possible to directly use `checkbashism` from `devscripts`
but it seems like even that has false positives (the code in lintian seems to have been
inspired from there).

shellcheck can make sense indeed, but it does not cover all heuristics that we currently
have. For example, checks for `shopt`, `unalias -a`, `SHLVL` etc are missing. OTOH, parsing
shellcheck output and making it exactly similar to current lintian output ensuring no
regression is a bit tricky. Maybe the output format in lintian will need to change.

Do you have thoughts/advice?

Thanks,
Nilesh
Technical Details
Message-ID: <O5bND-f8Yc-5@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
References: <O2CqZ-dG1h-7@gated-at.bofh.it> <O2CqZ-dG1h-7@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From: Nilesh Patra <nilesh@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1155004: lintian: Please use shellcheck to check for bashisms
Date: Mon, 30 Nov 2026 16:50:01 +0100
Message-ID: <O5bND-f8Yc-5@gated-at.bofh.it>
References: <O2CqZ-dG1h-7@gated-at.bofh.it> <O2CqZ-dG1h-7@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 30 15:43:07 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: Nilesh Patra <nilesh@debian.org>, 1155004@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: lintian-maint@debian.org
X-Debian-Pr-Message: followup 1155004
X-Debian-Pr-Package: lintian
X-Debian-Pr-Source: lintian
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Autocrypt: addr=nilesh@debian.org; keydata=
 xjMEYzwXMxYJKwYBBAHaRw8BAQdAsv3h7PxLm3vMbvdmN1bVnqUGyr3k2CKtdRmMDrX/jSXN
 IE5pbGVzaCBQYXRyYSA8bmlsZXNoQGRlYmlhbi5vcmc+wpAEExYIADgWIQSglbZu4JAkvuai
 8HIqJ5BL1yQ+2gUCYzwXMwIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRAqJ5BL1yQ+
 2hfuAQDBmH+Sec1bAb/BQNlnNOn7+o69yLi1S7bIQA67WpjCBwD9HoQ3dFMmHbDwu5Mi18z+
 0HoPHLKwQYWJCkOLn9vMFAHOOARjPBczEgorBgEEAZdVAQUBAQdAlnuvB8w06//G6pFqAo98
 IrNeskq+iLAbSPZ0Tse9zUIDAQgHwngEGBYIACAWIQSglbZu4JAkvuai8HIqJ5BL1yQ+2gUC
 YzwXMwIbDAAKCRAqJ5BL1yQ+2mzwAP0SR+JseZKh5BThCb5VijeJD2mCNhZFhvKYmlb8y6nb
 HwD/d3PmHHDDi6JR4oPGuYK/Z+j9tAiV5q8hGZilIFqfgQU=
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Debian-User: nilesh
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2006097
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 38
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 30 Nov 2026 21:11:23 +0530
X-Original-Message-ID: <02060be4-040d-4a0f-bd24-5920a1aaabb2@debian.org>
X-Original-References: <179544064001.1956470.10220455099642143787.reportbug@deep-thought> <179544064001.1956470.10220455099642143787.reportbug@deep-thought>