Skip to content

feat(check): support --no-error-on-unmatched-pattern flag#1354

Open
fengmk2 wants to merge 6 commits intorefactor-cli-othersfrom
support-no-error-on-unmatched-pattern
Open

feat(check): support --no-error-on-unmatched-pattern flag#1354
fengmk2 wants to merge 6 commits intorefactor-cli-othersfrom
support-no-error-on-unmatched-pattern

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 10, 2026

In --fix mode with file paths, implicitly suppress "no matching
files" errors for both fmt and lint. This fixes the lint-staged use
case where staged files may be excluded by ignorePatterns (e.g.
package-lock.json excluded by fmt ignorePatterns).

Also expose --no-error-on-unmatched-pattern as an explicit CLI
flag for non-fix use cases. oxfmt supports this flag natively; for
oxlint (which does not), vp check handles it by treating unparseable
lint output as a pass when the flag is active.

Closes #1210


Note

Medium Risk
Changes vp check exit-status behavior in edge cases (unmatched/ignored file patterns), which can affect CI and pre-commit workflows. Risk is mitigated by targeted suppression logic and new snapshot tests covering both pass and fail scenarios.

Overview
vp check now supports a new --no-error-on-unmatched-pattern flag and also implicitly enables it for the common --fix + explicit paths (lint-staged) flow, preventing non-zero exits when all provided paths are excluded/ignored.

The check orchestration updates how fmt/lint failures are interpreted: oxfmt is passed the flag directly, and lint “could not start” cases are only treated as success when suppression is active and the captured output is empty (so real lint/config errors still fail). Help text, RFC docs, and snapshot tests are updated/added to cover the new flag and edge cases.

Reviewed by Cursor Bugbot for commit a82d5a0. Configure here.

In `--fix` mode with file paths, implicitly suppress "no matching
files" errors for both fmt and lint. This fixes the lint-staged use
case where staged files may be excluded by ignorePatterns (e.g.
package-lock.json excluded by fmt ignorePatterns).

Also expose `--no-error-on-unmatched-pattern` as an explicit CLI
flag for non-fix use cases. oxfmt supports this flag natively; for
oxlint (which does not), vp check handles it by treating unparseable
lint output as a pass when the flag is active.

Closes #1210
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 10, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 force-pushed the support-no-error-on-unmatched-pattern branch from 507a843 to c9de266 Compare April 10, 2026 06:00
@fengmk2 fengmk2 force-pushed the refactor-cli-others branch from 08a95ab to 8e4d260 Compare April 10, 2026 06:00
@fengmk2 fengmk2 marked this pull request as ready for review April 10, 2026 06:01
@fengmk2 fengmk2 requested review from cpojer and leaysgur April 10, 2026 06:01
fengmk2 added 2 commits April 10, 2026 14:04
Invert the empty if-branch into a negated guard condition. Improve
comments to explain the asymmetry between fmt and lint None arms:
oxfmt handles the flag natively (exits 0), while oxlint does not
(exits non-zero), requiring an explicit status override.
@fengmk2 fengmk2 added the test: e2e Auto run e2e tests label Apr 10, 2026 — with Graphite App
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 10, 2026

@cursor review

Copy link
Copy Markdown
Contributor

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I suspect the output we're getting for now is NOT the intended behavior?

❯ vp check noop
VITE+ - The Unified Toolchain for the Web

error: Formatting could not start
Checking formatting...

Finished in 90ms on 0 files using 8 threads.
No files found matching the given patterns.

Formatting failed before analysis started
pass: Found no warnings, lint errors, or type errors in 0 files (82ms, 8 threads)

vp check [PATH] automatically set vp fmt --no-error-on-unmatched-pattern to surpress error, but it reports error.

Just wondering if this case also fixed?

fengmk2 added 3 commits April 10, 2026 14:53
… is active

Only suppress lint errors when the output is empty (no files to lint).
If oxlint produced error output (config error, crash, etc.), surface
it even when --no-error-on-unmatched-pattern is active.
…matched

Add snap test that runs `vp check --fix` with paths (activating
suppress_unmatched) on a file with a real lint error, confirming the
error is still surfaced and the command exits non-zero.
Replace .oxlintrc.json with vite.config.ts in the
check-fix-lint-error-not-swallowed snap test to match the preferred
configuration style used across other snap tests.
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 10, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a82d5a0. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants