Skip to content

feat: emit <no-hash> for zero-match entries instead of failing#21

Merged
maastrich merged 1 commit intomainfrom
feat/no-hash-sentinel
Apr 24, 2026
Merged

feat: emit <no-hash> for zero-match entries instead of failing#21
maastrich merged 1 commit intomainfrom
feat/no-hash-sentinel

Conversation

@maastrich
Copy link
Copy Markdown
Owner

Summary

When a config entry's glob matches zero files, hashup now emits the sentinel <no-hash> for that entry and continues processing the rest instead of aborting the whole run.

app           48adf62a70c2645d0fc15ee3060973245af5dc30a542372791a7e1f05eaeacf6
visual-tests  <no-hash>
worker        0c4b8d9f…

In --json mode: { "hash": "<no-hash>", "files": [] }. The sentinel is also exported as NO_HASH from src/cli/run-config-mode.ts for programmatic callers.

Motivation

Monorepo configs regularly glob files that aren't always present — a package that doesn't have visual tests yet, a feature-flagged directory, a generated dir that hasn't been seeded. Previously a single zero-match entry aborted the invocation; now it's a local, addressable signal downstream tooling can detect without gate-keeping the whole run.

Test plan

  • Updated tests/cli/run-modes.test.ts:
    • Mixed config ({ none: "src/*.missing", real: "src/a.ts" }) succeeds; none emits <no-hash>, real emits a real digest
    • --json + --files for a zero-match entry emits { hash: "<no-hash>", files: [] }
  • vp test — 121/121 passing
  • vp check clean
  • End-to-end smoke in both plain and JSON CLI modes

Docs

docs/guide/cli.md — replaced the "zero-match is an error" paragraph with the new sentinel behavior and a sample output block.

🤖 Generated with Claude Code

Monorepo configs often glob files that aren't always present
(unreleased features, feature-flagged directories, packages that
don't have tests yet). A single zero-match entry shouldn't abort
the entire invocation. Return a <no-hash> sentinel and keep going.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

📖 Docs preview: https://maastrich.github.io/hashup/branches/pr-21/

@maastrich maastrich merged commit ab4b73b into main Apr 24, 2026
3 checks passed
@maastrich maastrich deleted the feat/no-hash-sentinel branch April 24, 2026 13:05
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