Repository navigation
tests/grep-q-pipes: fail when a scan pathspec matches nothing - #597
Merged
derekross merged 1 commit intoNov 10, 2026
Merged
Conversation
The scan's pathspec 'packages/*/test' matched no file: a git pathspec with a wildcard has to match the whole path. So from derekross#575 until a81fcf3 the test read none of the package tests and still printed ok, and a pipe into grep -q appended to a package test passed (found on derekross#587). Check each scan pathspec before the scan: tests, 'packages/*/test/*', bin, tools and rootfs must each add a script that sets pipefail, with the scan's exclusions applied (so 'tests' can't pass on this file alone), and tools/lib, whose files are sourced by pipefail scripts, must hold a file. An empty one fails with its name. The exclusions now live in one list that the check and the scan share. With 'packages/*/test' put back the test fails with not ok - the pathspec 'packages/*/test' matches a pipefail script and so does each other pathspec misspelled in turn; with main's pathspecs it passes on 165 scripts. Main's test with the old pathspec passed on 92. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 of 9 tasks
Owner
|
Thank you, this closes the hole properly. A lint that reads nothing and prints ok is the worst kind, and now a wrong pathspec fails with its name. I ran it here: the committed test passes on 165 scripts (166 merged onto today's main, the same set main's test scans), |
robertzas
pushed a commit
to robertzas/omarchy-mobile
that referenced
this pull request
Nov 14, 2026
…oss#597) A scan pathspec that matched no file made the lint read nothing and print ok. Each pathspec now fails by name when it matches nothing. It scans the same scripts as before.
6 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
On #587 the maintainer found that the scan's pathspec
'packages/*/test'matched no file (a git pathspec with a wildcard has to match the whole path), so from #575 until a81fcf3tests/grep-q-pipesread none of the package tests and still printed ok. a81fcf3 fixed the pathspec; this makes a wrong one fail loudly (review lesson L-419: a check must be able to fail).Before the scan, each scan pathspec (
tests,'packages/*/test/*',bin,tools,rootfs) must add at least one script that sets pipefail, with the scan's exclusions applied, andtools/lib, whose files are sourced by pipefail scripts, must hold a file. An empty one fails with its name. The pathspecs and exclusions are one list each, shared by the check and the scan.Failing first:
testz,bimandrootfin place oftests,binandrootfseach fail with their name too, and so does atools/libremoved from a temporary index.Other git pathspec users in tests/: none that can go empty unnoticed.
tests/owl/lint/new-warningspasses a literal path togit archive, which errors on no match;tests/repo-publishonly fakesgit ls-files.Device and build
uname -r): n/aChecks (no phone needed)
tools/pr-check origin/mainpassestests/allpasses (500 ok, 0 not ok)tests/packages: no package touchedversionbumped, and the new version is in the commit subject (no package changed)Co-Authored-By:orAssisted-by:trailer, never aSigned-off-by:On the phone
userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)tools/phone-smokereportNot applicable: test-only (CONTRIBUTING.md §6.5).
Generated with Claude Opus 5.5 in T3 Code Nightly