Skip to content

Feature/shellcheck#144

Merged
blooop merged 6 commits intomainfrom
feature/shellcheck
Mar 1, 2026
Merged

Feature/shellcheck#144
blooop merged 6 commits intomainfrom
feature/shellcheck

Conversation

@blooop
Copy link
Owner

@blooop blooop commented Mar 1, 2026

Summary by Sourcery

Add shell script linting with ShellCheck and update existing shell scripts for correctness and compatibility.

New Features:

  • Introduce a local pre-commit hook to run ShellCheck on shell scripts via pixi.

Enhancements:

  • Improve shell scripts by quoting variable expansions and adjusting shebangs and environment setup lines for safer execution and ShellCheck compliance.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 1, 2026

Reviewer's Guide

Adds ShellCheck linting via pre-commit and updates existing shell scripts to satisfy ShellCheck recommendations, mainly by fixing quoting issues, specifying bash where needed, and documenting intentional ShellCheck rule suppressions.

File-Level Changes

Change Details Files
Add a local pre-commit hook to run ShellCheck using pixi for shell scripts.
  • Configure a new local pre-commit repo entry for a shellcheck hook
  • Set hook language to system with entry pixi run shellcheck
  • Scope the hook to files of type shell
.pre-commit-config.yaml
Harden virtualenv activation in the VS Code launcher script and annotate ShellCheck suppressions.
  • Quote VENV_DIR in source commands to avoid word splitting and globbing issues
  • Add ShellCheck disable comment SC1091 before sourcing venv activation script
scripts/launch_vscode.sh
Improve safety and ShellCheck compliance in the host setup script.
  • Quote loop variable when removing docker-related packages with apt-get
  • Add ShellCheck disable comment SC1091 for sourcing /etc/os-release in a subshell
  • Add ShellCheck disable comment SC2016 for literal expansion line added to .bashrc
  • Quote $USER in usermod docker group command to avoid word splitting issues
scripts/setup_host.sh
Align Claude Code devcontainer install script with bash-specific and ShellCheck expectations.
  • Change shebang from /bin/sh to /bin/bash for bash-specific usage
  • Add ShellCheck disable comment SC2016 on PATH export line containing literal variable expansions
  • Add ShellCheck disable comment SC2016 on env PATH workaround line with literal variable expansions
.devcontainer/claude-code/install.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new local shellcheck pre-commit hook assumes pixi is available on the PATH; consider guarding it with a condition or documenting/configuring an alternative entry so that contributors without pixi can still run pre-commit.
  • Now that you're tightening shell script hygiene, it may be worth adding set -o pipefail (where supported) to the top of the bash scripts so that failures in pipelines are surfaced instead of being silently ignored.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new local `shellcheck` pre-commit hook assumes `pixi` is available on the PATH; consider guarding it with a `condition` or documenting/configuring an alternative entry so that contributors without pixi can still run pre-commit.
- Now that you're tightening shell script hygiene, it may be worth adding `set -o pipefail` (where supported) to the top of the bash scripts so that failures in pipelines are surfaced instead of being silently ignored.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

blooop added 4 commits March 1, 2026 13:08
The local system hook using `pixi run shellcheck` fails in CI because
pixi is not available in the prek-action environment. Switch to the
official shellcheck-precommit repo which bundles its own binary.
@blooop blooop merged commit b1f3b99 into main Mar 1, 2026
8 checks passed
@blooop blooop deleted the feature/shellcheck branch March 1, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant