fix(cli): exit 0 when all fmt input files are excluded by ignorePatterns#1225
Open
nickytonline wants to merge 2 commits intovoidzero-dev:mainfrom
Open
fix(cli): exit 0 when all fmt input files are excluded by ignorePatterns#1225nickytonline wants to merge 2 commits intovoidzero-dev:mainfrom
nickytonline wants to merge 2 commits intovoidzero-dev:mainfrom
Conversation
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
e724b4d to
976155c
Compare
nickytonline
commented
Mar 30, 2026
| .get("ignorePatterns") | ||
| .and_then(|v| v.as_array()) | ||
| .is_some_and(|arr| !arr.is_empty()) | ||
| && !has_flag_before_terminator(&args, "--no-error-on-unmatched-pattern") |
Author
There was a problem hiding this comment.
Adding --no-error-on-unmatched-pattern, seemed to make the most sense to handle this.
Member
There was a problem hiding this comment.
@leaysgur Can this fix be implemented by oxfmt itself?
Contributor
There was a problem hiding this comment.
This flag exists for a reason, so it should be explicitly specified by the
caller who knows that zero matches are expected.
https://oxc.rs/docs/guide/usage/formatter/ci.html#pre-commit-hook
Author
When `vp staged` passes files to `vp fmt` that are all excluded by ignorePatterns in vite.config.ts (e.g., package-lock.json), oxfmt would error with "Expected at least one target file". Now vp fmt automatically adds `--no-error-on-unmatched-pattern` when the fmt config has ignorePatterns, so it exits 0 gracefully instead. Closes voidzero-dev#1210 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a51dac6 to
68ccdf8
Compare
Author
|
had to update the snap test for Windows. |
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.

Summary
When
vp stagedpasses files tovp fmtthat are all excluded by ignorePatterns in vite.config.ts (e.g., package-lock.json), oxfmt would error with "Expected at least one target file". Nowvp fmtautomatically adds--no-error-on-unmatched-patternwhen the fmt config has ignorePatterns, so it exits 0 gracefully instead.Closes #1210
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com