Skip to content

Scripts: build-arch.sh and check-readback.sh do not pass shellcheck - #166

Merged
nofuturekid merged 7 commits into
rebuildfrom
fix/154-shellcheck-old-scripts
Nov 13, 2026
Merged

nofuturekid merged 7 commits into
rebuildfrom
fix/154-shellcheck-old-scripts

Conversation

@nofuturekid

@nofuturekid nofuturekid commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #154

What changed

  • scripts/build-arch.sh: cp "$pkg" "$out" (SC2086). The glob in pkg=$(ls ...) matches the one package makepkg writes into the fresh work directory.
  • scripts/check-readback.sh: "$b" quoted in the seven try/chk calls (SC2086); the retry loop uses for _ in 1 2 (SC2034). $v is on/off and $b is true/false, so the arguments are the same as before.
  • Groundwork plan (docs/superpowers/plans/2026-11-13-obsbot4linux-groundwork.md): the shellcheck gate line now covers scripts/*.sh scripts/groundwork/*.sh, and the notes that left the old scripts alone are updated. ci.yml has no shellcheck step; this is the only place the gate is defined.

No CHANGELOG line (no user-visible change).

Verification (no camera, no Rust change)

  • shellcheck scripts/*.sh scripts/groundwork/*.sh prints nothing (before: 1 finding in build-arch.sh, 8 in check-readback.sh).
  • bash -n scripts/check-readback.sh and sh -n scripts/build-arch.sh pass.
  • Behaviour: ran the old and the new check-readback.sh against a stub binary (OBSBOT4LINUX=stub, fixed JSON output, sleep replaced by a no-op). Both logged the same 129 invocations in the same order, and printed identical output (50 lines, same exit code). The stub does not open a device.
  • build-arch.sh needs docker and an Arch image; it was checked by shellcheck and by reading only. The Arch package build runs as a dry run of the release workflow on this pull request (it triggers on scripts/**); both arch jobs (x86_64 and aarch64) passed.
  • cargo fmt/clippy/test not run: no Rust file changed.

🤖 Generated with Claude Code

@nofuturekid nofuturekid added the bug Something isn't working label Nov 13, 2026
nofuturekid and others added 7 commits November 13, 2026 13:14
Camera::answer read the device directly, so no test reached its arms. The poll is now
poll_answer, which takes the selector-2 read as a closure and the gap as an argument;
Camera::answer passes the device read and the same 50 ms gap, so what is sent and read
on the camera is unchanged. Tests script the replies: a rejected answer returns
Error::Rejected(command, code) at the first read, an empty answer returns an empty list,
a stale answer runs through all 20 reads to NoAnswer, and failed reads are polled again
until a value arrives.

Fixes #151

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The test module already gets XU_SIZE through use super::*.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
full_status_with reads the device directly, so no test reached the arm that turns a rejected
or unanswered tracking query (0x0104) into tracking: None. Tests now run it on a scripted
Device (compiled in tests only, answering xu_get, xu_set, get_ctrl and ctrl_range from a
table): a rejected tracking query returns Ok with tracking None and the other fields filled,
an answered one fills tracking, and a failed write still fails the whole read. No status code
and no byte sent to the camera changed.

Fixes #152

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Do not claim how a camera treats an unknown query; the comment now says
what the test double does (type 0x89, code -1) and why.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Camera::gimbal sent the tilt negated inline; no test covered it, so
deleting the minus would have left every test green and made
`gimbal --tilt 20` move the camera down.

The negation (with the + 0.0 that keeps -0.0 off the wire) is now
tilt_to_pitch, which gimbal calls. The bytes sent for any input are
unchanged (byte guard and command-line guard pass unchanged).

Tests: positive tilt up gives the negated value, 0 stays +0.0, None
stays None, and the converted value builds the two pose frames of
capture 18 byte for byte.

Fixes #153

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Quote $pkg in build-arch.sh (SC2086) and $b in the try and chk calls of
check-readback.sh (SC2086); name the unused retry counter `_` (SC2034).
No change in behaviour. The groundwork gate now runs shellcheck over
scripts/*.sh and scripts/groundwork/*.sh.

Fixes #154

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Precondition P5 still said the gate checks only the new scripts and that
an issue is filed on main. Issue #154 fixes the old findings on rebuild,
and the gate line covers every script in scripts/.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nofuturekid
nofuturekid force-pushed the fix/154-shellcheck-old-scripts branch from 0ee6347 to 56731ce Compare November 13, 2026 12:29
@nofuturekid
nofuturekid merged commit 56731ce into rebuild Nov 13, 2026
20 checks passed
@nofuturekid
nofuturekid deleted the fix/154-shellcheck-old-scripts branch November 13, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant