Skip to content

Fix shell lint baseline warnings#1677

Draft
arittr wants to merge 1 commit into
devfrom
codex/shell-lint-baseline-fixes
Draft

Fix shell lint baseline warnings#1677
arittr wants to merge 1 commit into
devfrom
codex/shell-lint-baseline-fixes

Conversation

@arittr

@arittr arittr commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

What problem are you trying to solve?

After #1676 introduced scripts/lint-shell.sh --all, the first warning-level ShellCheck baseline run failed on existing tracked shell scripts. That meant the repo would have a useful shell lint command, but agents and reviewers would not be able to treat new warning-level findings as regressions because the baseline already started red.

The initial baseline exposed 14 warning-level findings: SC2155 in tests/claude-code/test-helpers.sh, SC2088 in tests/claude-code/test-worktree-path-policy.sh, SC2034 in the brainstorming server start/stop scripts, SC2064 and SC2320 in the subagent integration test, and SC2164 in skills/brainstorming/scripts/start-server.sh.

What does this PR change?

Fixes the warning-level ShellCheck findings exposed by #1676 without changing the tooling branch. The fixes split declaration/assignment pairs, preserve the real pipeline exit status in the integration test, keep legacy ~/.config/superpowers/worktrees assertions literal, handle cd failure in start-server.sh, and rename intentionally-unused loop variables.

Is this change appropriate for the core library?

Yes. These are small correctness and maintainability fixes to existing core shell scripts/tests so the repository can adopt a clean shell lint baseline. This does not add a dependency, does not add a new harness, does not introduce project-specific configuration, and does not modify behavior-shaping skill prose.

What alternatives did you consider?

  1. Suppress the warnings inline with ShellCheck directives: rejected because these were straightforward to fix directly, and suppressions would teach agents to paper over useful findings.
  2. Lower the baseline below warning severity: rejected because warning severity is the useful minimum for catching likely shell hazards.
  3. Fold these fixes into Add shell lint script #1676: rejected to keep the tooling PR reviewable. Add shell lint script #1676 introduces the script; this stacked PR makes the existing repo pass the new baseline.
  4. Focus on shfmt first: rejected because formatter churn is separate from warning-level correctness. shfmt can be a later mechanical PR.

Does this PR contain multiple unrelated changes?

No. Every file change is directly tied to making the ShellCheck warning baseline pass. The branch is stacked above #1676 because it depends on the lint script introduced there.

Existing PRs

Searches reviewed: shell lint, lint-shell, ShellCheck, shfmt, and bash lint across open and closed PRs. I did not find an earlier PR fixing a repository-wide ShellCheck baseline for tracked shell scripts.

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Codex desktop + local shell Not exposed in session GPT-5 Codex Not exposed in session

Local verification performed on macOS / Darwin 25 with Bash, ShellCheck, and shfmt available.

Commands run:

git diff --check
scripts/lint-shell.sh --all
bash tests/claude-code/test-worktree-path-policy.sh
bash tests/shell-lint/test-lint-shell.sh
bash tests/brainstorm-server/windows-lifecycle.test.sh

Observed results: scripts/lint-shell.sh --all passes on the rebased stack, linting 31 shell files. The shell lint tests and worktree path policy test passed. The brainstorming server lifecycle test passed with 9 passed, 0 failed, and 3 Windows-specific skips on macOS.

New harness support (required if this PR adds a new harness)

Not applicable. This PR does not add a new harness.

Evaluation

  • Initial prompt: Drew asked to run the new shell baseline, then update tooling first and start fixing the scripts themselves on a new stacked branch above the tooling PR.
  • How many eval sessions after making the change: 0 agent-behavior eval sessions. This is a shell-script cleanup, not a behavior-shaping skill change.
  • Observed outcome: Before this PR, scripts/lint-shell.sh --all failed with 14 warning-level ShellCheck findings. After this PR, the same baseline passes on the rebased stack. The targeted tests around the changed helper/policy/lifecycle paths also pass.

Rigor

  • N/A: this is not a skills change, so superpowers:writing-skills adversarial testing is not required.
  • This change was tested against the failing baseline, not only by inspection: the warning-level ShellCheck baseline was run before fixing and again after fixing, and targeted tests were run for changed shell helper/policy/lifecycle behavior.
  • I did not modify carefully-tuned content (Red Flags table, rationalization lists, "human partner" language).

Human review

  • Drew Ritter, a maintainer, directed this work in-session, reviewed the scope and tradeoffs, and requested the commit/stack. This PR body update exists to document that human involvement explicitly.

AI was used for implementation assistance.

Stack created with GitHub Stacks CLIGive Feedback

@arittr arittr mentioned this pull request Jun 1, 2026
5 tasks
@arittr arittr force-pushed the codex/shell-lint-baseline-fixes branch from 055efbf to 4c95100 Compare June 1, 2026 21:31
@arittr arittr marked this pull request as draft June 2, 2026 05:49
@arittr arittr force-pushed the codex/shell-lint-baseline-fixes branch from 4c95100 to cb6bdf9 Compare June 2, 2026 22:36
@arittr arittr changed the base branch from codex/shell-lint-script to dev June 2, 2026 22:36
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