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

🐛 --changed doesn't work when run on the base branch even if --no-errors-on-unmatched is enabled #1774

Closed
1 task done
antogyn opened this issue Feb 9, 2024 · 10 comments · Fixed by #1776
Closed
1 task done
Labels
A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@antogyn
Copy link
Contributor

antogyn commented Feb 9, 2024

Environment information

CLI:
  Version:                      1.5.3-nightly.24fcf19
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.14.2"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.19"

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

Workspace:
  Open Documents:               0

What happened?

  1. Set your defaultBranch to master
  2. Run git checkout master
  3. Run biome check --changed --no-errors-on-unmatched --files-ignore-unknown=true .

Alternatively

  1. Just run biome check --changed --no-errors-on-unmatched --since=head .

It shows this error:

internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ No files were processed in the specified paths.

Expected result

It should not return an error

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico
Copy link
Member

Can you share a small repository with so we can replicate the issue?

@ematipico ematipico added the S-Needs repro Status: needs a reproduction label Feb 9, 2024
@antogyn
Copy link
Contributor Author

antogyn commented Feb 9, 2024

https://github.com/antogyn/biome-issue-1774

Same issue with 1.5.3 instead of 1.5.3-nightly.24fcf19 (which I needed because of a recent fix)

I think you can simply run this command on any project with git integration enabled to trigger the error:

biome check --changed --no-errors-on-unmatched --since=head .

Edit: in case it's useful

git -v
# git version 2.39.3 (Apple Git-145)

@antogyn
Copy link
Contributor Author

antogyn commented Feb 9, 2024

Taking a glance at the code, it seems the error is triggered here:

https://github.com/biomejs/biome/blob/main/crates/biome_cli/src/changed.rs#L28

My suggestion would to simply drop this check, since the --no-errors-on-unmatched flag is handled later in execute_mode

@ematipico ematipico added A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug and removed S-Needs repro Status: needs a reproduction labels Feb 9, 2024
@ematipico
Copy link
Member

Yeah, that seems about right. Do you want to send a PR?

@antogyn
Copy link
Contributor Author

antogyn commented Feb 9, 2024

I'm a Rust noob but I'll give it a shot

@ematipico
Copy link
Member

I'm a Rust noob but I'll give it a shot

No worries! Let's start by deleting the lines and doing a draft PR. Then I will help you :)

@antogyn
Copy link
Contributor Author

antogyn commented Feb 9, 2024

Can you give me pointers on tests? It looks like the change doesn't break any, and I'm not sure where to start

@ray-peters
Copy link

ray-peters commented Mar 4, 2024

Hey team, any update on this front? Is there anything we can do to help move this along? I'm seeing helpful commentary on antogyn's PR.

Just integrated biome into our ci/cd pipeline and running into the same issue as reported above.

@ematipico
Copy link
Member

ematipico commented Mar 4, 2024

You'll get the fix in the next release v1.6. If you require the fix ASAP, I can publish a nightly tomorrow

@ray-peters
Copy link

@ematipico Thank you for jumping on this issue. A nightly release would be really great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants