lint: shellcheck files with shell shebang #36742

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2611-lint-shellcheck-shebang changing 8 files +39 −44
  1. maflcko commented at 10:53 AM on November 3, 2026: member

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

  2. DrahtBot added the label Tests on Nov 3, 2026
  3. DrahtBot commented at 10:54 AM on November 3, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    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 <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-->

  4. hebasto commented at 11:19 AM on November 3, 2026: member

    Concept ACK.

  5. lint: shellcheck files with shell shebang faf5cc398b
  6. lint: Remove global shellcheck exclude of SC2162
    None of the read calls are expected to parse backslash escapes. Use
    `read -r` to preserve literal backslashes if they occur.
    fa2028daaa
  7. maflcko force-pushed on Nov 13, 2026
  8. maflcko requested review from hebasto on Nov 16, 2026
  9. in test/lint/lint-shell.py:40 in fa2028daaa
      35 | +        with open(file, "rb") as script:
      36 | +            if reg.match(script.readline()):
      37 | +                shebang_files.append(file)
      38 | +
      39 | +    return shebang_files
      40 | +
    


    hebasto commented at 4:23 PM on November 16, 2026:

    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.


    maflcko commented at 4:39 PM on November 16, 2026:

    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

  10. hebasto commented at 4:35 PM on November 16, 2026: member

    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?

  11. maflcko commented at 4:40 PM on November 16, 2026: member

    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: #36749 (comment)

  12. hebasto approved
  13. hebasto commented at 4:46 PM on November 16, 2026: member

    ACK fa2028daaa461accf93737ae82e513068c715d47.

  14. maflcko requested review from fanquake on Nov 20, 2026
  15. in ci/retry/retry:7 in fa2028daaa
       3 | @@ -4,7 +4,7 @@ __sleep_amount() {
       4 |    if [ -n "$constant_sleep" ]; then
       5 |      sleep_time=$constant_sleep
       6 |    else
       7 | -    sleep_time=`awk "BEGIN {t = $min_sleep * $(( (1<<($attempts -1)) )); print (t > $max_sleep ? $max_sleep : t)}"`
       8 | +    sleep_time=$(awk "BEGIN {t = $min_sleep * $((1 << (attempts - 1))); print (t > $max_sleep ? $max_sleep : t)}")
    


    fanquake commented at 1:42 PM on November 20, 2026:

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

  16. fanquake merged this on Nov 20, 2026
  17. fanquake closed this on Nov 20, 2026

  18. maflcko deleted the branch on Nov 20, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-12-01 02:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me