On 23/11/26 7:00 pm, Benjamin Drung wrote:
> Package: lintian
> Version: 2.144.0
> Severity: wishlist
> X-Debbugs-Cc: [email protected]
> 
> 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

Reply via email to