lint: shellcheck files with shell shebang #36742

Manually merged
maflcko merged 2 commits from 2611-lint-shellcheck-shebang into master 2026-11-20 13:52:38 +00:00 AGit
maflcko commented 2026-11-03 10:53:55 +00:00 (Migrated from github.com)

The current shellcheck lint silently ignores all files with a shell shebang that are not ending in .sh.

Fix it by linting them, which also simplifies the script, because manually appending of guix scripts can be dropped.

Also, remove global shellcheck exclude of SC2162 (read -r).

The current shellcheck lint silently ignores all files with a shell shebang that are not ending in `.sh`. Fix it by linting them, which also simplifies the script, because manually appending of guix scripts can be dropped. Also, remove global shellcheck exclude of SC2162 (read -r).
DrahtBot commented 2026-11-03 10:54:05 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK hebasto

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

No conflicts as of last run.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36742 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36742.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36742#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [hebasto](https://github.com/bitcoin/bitcoin/pull/36742#pullrequestreview-5923798264) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts No conflicts as of last run. <!--5faf32d7da4f0f540f40219e4f7537a3-->
hebasto (Migrated from github.com) reviewed 2026-11-03 11:19:52 +00:00
hebasto (Migrated from github.com) left a comment

Concept ACK.

Concept ACK.
First-time contributor

🟠 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).

🔵 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).

Review coverage was incomplete.


Reviewed: fa2028daaa46 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:464886e574fc96b3587e582688c29b6bd7a73bba755cfc1d2f031cc648c7ec97:a99dfe27a5d9c587aaf93be1a4842812699d6122d1d9babba7210869336cc02c --> <!-- ralph-base:9183edd25e60aa410bc3e4728989a1d75c309a09 --> <!-- ralph-head:fa2028daaa461accf93737ae82e513068c715d47 --> <!-- ralph-case:2d18e2fa793abb6b72e176508abc5ef7065300a6d3f19337f5d69367be2b7bb0 --> **🟠 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`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/fa2028daaa461accf93737ae82e513068c715d47/test/lint/lint-shell.py#L63>) (head). **🔵 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`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/fa2028daaa461accf93737ae82e513068c715d47/contrib/macdeploy/detached-sig-create.sh#L34>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`fa2028daaa46`](<https://git.fish.foo/bitcoin/bitcoin/commit/fa2028daaa461accf93737ae82e513068c715d47>) · [Review report](<https://review.fish.foo/report/36742-fa2028daaa461accf93737ae82e513068c715d47-2637-3.html>) · [Previous reports](<https://review.fish.foo/traces/36742/>) [permalink](<https://review.fish.foo/report/36742-fa2028daaa461accf93737ae82e513068c715d47-2637-3.html>)
hebasto (Migrated from github.com) reviewed 2026-11-16 16:29:18 +00:00
hebasto (Migrated from github.com) commented 2026-11-16 16:23:25 +00:00

The new get_shebang_files() function picks up the vendored ci/retry/retry, depends/config.guess and depends/config.sub. The first had to be modified to pass the check, and the last two happen to pass it at the moment. However, I don't think we want to check any of them in the first place.

The new `get_shebang_files()` function picks up the vendored `ci/retry/retry`, `depends/config.guess` and `depends/config.sub`. The first had to be modified to pass the check, and the last two happen to pass it at the moment. However, I don't think we want to check any of them in the first place.
hebasto (Migrated from github.com) reviewed 2026-11-16 16:35:48 +00:00
hebasto (Migrated from github.com) left a comment

The following pre-existing code seems to be broken:github.com/bitcoin/bitcoin@fa2028daaa/test/lint/lint-shell.py (L64)

For example, it causes the whole src/ipc/ subdirectory to be skipped.

Could it be fixed in this PR as well?

The following pre-existing code seems to be broken:https://github.com/bitcoin/bitcoin/blob/fa2028daaa461accf93737ae82e513068c715d47/test/lint/lint-shell.py#L64 For example, it causes the whole `src/ipc/` subdirectory to be skipped. Could it be fixed in this PR as well?
maflcko (Migrated from github.com) reviewed 2026-11-16 16:39:27 +00:00
maflcko (Migrated from github.com) commented 2026-11-16 16:39:27 +00:00

Why not? ci/retry/retry is maintained in-tree, and already heavily modified, so it must be checked. If the config stuff fails, it would be trivial to exclude it

Why not? `ci/retry/retry` is maintained in-tree, and already heavily modified, so it must be checked. If the config stuff fails, it would be trivial to exclude it
maflcko commented 2026-11-16 16:40:09 +00:00 (Migrated from github.com)

The following pre-existing code seems to be broken:

It is not broken. It works correctly by accident. I don't know how to fix it, so let's leave it for later: https://github.com/bitcoin/bitcoin/pull/36749#issuecomment-6625819678

> The following pre-existing code seems to be broken: It is not broken. It works correctly by accident. I don't know how to fix it, so let's leave it for later: https://github.com/bitcoin/bitcoin/pull/36749#issuecomment-6625819678
hebasto (Migrated from github.com) approved these changes 2026-11-16 16:46:03 +00:00
hebasto (Migrated from github.com) left a comment

ACK fa2028daaa.

ACK fa2028daaa461accf93737ae82e513068c715d47.
fanquake (Migrated from github.com) reviewed 2026-11-20 13:41:59 +00:00
fanquake (Migrated from github.com) commented 2026-11-20 13:42:00 +00:00

I think we can probably just delete / cleanup more of this code, but that can be done later.

I think we can probably just delete / cleanup more of this code, but that can be done later.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36742
No description provided.