Skip to content

Fix periphery's stale-index false positives and shellcheck SC1091 in single-file runs - #376

Merged
alexkroman merged 2 commits into
mainfrom
fix/periphery-stale-index
Nov 25, 2026
Merged

alexkroman merged 2 commits into
mainfrom
fix/periphery-stale-index

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Tooling fixes found while verifying #347–#349. No app code changes.

Periphery reported live code as unused (TermField, Caret)

Every local scripts/ios-check.sh (so every local check.sh) failed periphery on main:

BlurtKeyboard/Sources/TermField.swift:8:8: warning: Unused struct 'TermField'
BlurtKeyboard/Sources/TermField.swift:48:16: warning: Unused struct 'Caret'

Both are used (BlurtToolbar.swift:25). The line numbers are from the file before #315; today they are declared on lines 9 and 52. Periphery keeps its DerivedData in ~/Library/Caches/com.github.peripheryapp, and an index unit whose output is no longer produced is never replaced, so the scan read a stale pre-#315 declaration with none of today's references. With --clean-build the same scan reports "No unused code detected." CI's fresh runners were unaffected, which is why this only showed up locally. (Every main check run since #315 was cancelled, so CI never ran periphery on it either.)

SC1091 when shellcheck lints one script alone

A repo-root .shellcheckrc (external-sources=true, source-path=SCRIPTDIR, source-path=SCRIPTDIR/..) makes source "$REPO_ROOT/scripts/…" and the hooks' source "$(dirname "$0")/hook-lib.sh" resolve in any invocation (an editor, a single file, any working directory), not only in check.sh's one run over all the scripts. The explanations in CLAUDE.md and check.sh are updated.

scripts/check.sh --portable passes.

🤖 Generated with Claude Code

alexkroman-assembly and others added 2 commits November 24, 2026 14:51
Periphery keeps its DerivedData between runs, and an index unit whose
output is no longer produced is never replaced. After #315 that left a
pre-redesign unit for TermField.swift in the store, so every local
ios-check reported TermField and Caret as unused (at the old file's line
numbers) though BlurtToolbar uses both. A clean build drops the stale
units; CI's fresh runners were unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A repo-root .shellcheckrc (external-sources + source-path SCRIPTDIR and
SCRIPTDIR/..) lets shellcheck follow `source "$REPO_ROOT/scripts/…"`
and the hooks' `source "$(dirname "$0")/hook-lib.sh"` when one
script is linted alone, so an editor or a single-file run no longer
raises SC1091 notes that check.sh's all-at-once invocation hides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexkroman
alexkroman enabled auto-merge November 24, 2026 22:57
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 7114bf5 Nov 25, 2026
19 of 21 checks passed
@alexkroman
alexkroman deleted the fix/periphery-stale-index branch November 25, 2026 01:13
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.

2 participants