lint: shellcheck files with shell shebang

bitcoin/bitcoin: PR #36742

1 minor finding · 1 suggestion

Findings

Link

[minor] · The subtree filter also excludes unrelated src/ directories

The combined discovery list now uses a pre-existing character-class filter that would silently exclude scripts under directories such as src/test/; no current affected non-vendored script was found.

Location: test/lint/lint-shell.py:63 (head).

Details and suggested fix

[leveldb,secp256k1,minisketch] matches one character, so reg.match excludes any path beginning with, for example, src/t, src/b, or src/n. Previously only the *.sh list passed through this filter; now shebang-discovered and # shellcheck shell= files do too. A script under src/test/ would therefore be discarded despite successful discovery. Use prefix checks against SHARED_EXCLUDED_SUBTREES from lint_ignore_dirs.py. Its full six-directory list preserves the vendored exclusions, including src/ipc/libmultiprocess/, which a correction naming only the three directories in this regex would miss.


Optional improvements

Link

[suggestion] · Passphrase reads still trim surrounding whitespace

As a pre-existing limitation, the signing prompts strip leading and trailing spaces and tabs despite read -r; no affected signer is known, but IFS= read -r would preserve these passphrases.

Location: contrib/macdeploy/detached-sig-create.sh:34 (head).

Details and suggested fix

-r preserves backslashes but does not disable default IFS whitespace trimming. A whitespace-bordered passphrase would consequently reach signapple's --passphrase or osslsigncode's -pass argument with different bytes, preventing authentication with that passphrase. While changing these prompts, consider using IFS= read -r cs_key_pass, likewise for api_key_pass and the Windows prompt. This is portable /bin/sh syntax and confines the IFS change to each read.


Coverage details