Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 --staged throws an error if no files affected #5064

Closed
1 task done
apetta opened this issue Feb 9, 2025 · 1 comment
Closed
1 task done

🐛 --staged throws an error if no files affected #5064

apetta opened this issue Feb 9, 2025 · 1 comment
Labels
S-Needs triage Status: this issue needs to be triaged

Comments

@apetta
Copy link

apetta commented Feb 9, 2025

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v23.6.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/10.2.1"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

Running cli commands w/ --staged throws an error if biome does not have any files to look at. This is problematic when using biome in a pre-commit hook w/ changes to files that biome doesn't format/lint (excluded through config).

See example output:

//:check: > biome check . --staged
//:check: 
//:check: Checked 0 files in 116µs. No fixes applied.
//:check: internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
//:check: 
//:check:   × No files were processed in the specified paths.
//:check:   
//:check: 
//:check:  ELIFECYCLE  Command failed with exit code 1.

Expected result

It should not throw an error, and instead resolve successfully even if no files are affected.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@apetta apetta added the S-Needs triage Status: this issue needs to be triaged label Feb 9, 2025
@apetta
Copy link
Author

apetta commented Feb 9, 2025

--no-errors-on-unmatched is what I'm after

@apetta apetta closed this as completed Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs triage Status: this issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant