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

You cannot combine: --no-cache --fail-on-change #343

Closed
terlar opened this issue Jul 5, 2024 · 3 comments · Fixed by #344
Closed

You cannot combine: --no-cache --fail-on-change #343

terlar opened this issue Jul 5, 2024 · 3 comments · Fixed by #344
Assignees
Labels
bug Something isn't working

Comments

@terlar
Copy link

terlar commented Jul 5, 2024

Describe the bug

If you use --no-cache, the option --fail-on-change won't have any effect.

To Reproduce

Steps to reproduce the behavior:

  1. git init
  2. Create a file no-cache-fail-on-change-bug.yaml:
key1: value1

key2: value2


key3: value3
  1. git add no-cache-fail-on-change-bug.yaml
  2. Configure treefmt with yamlfmt
  3. Run treefmt --no-cache --fail-on-change
  4. Observe no errors, but the file has changed
  5. git checkout no-cache-fail-on-change-bug.yaml
  6. Repeat steps with treefmt --fail-on-change
  7. Observe treefmt: error: unexpected changes detected, --fail-on-change is enabled

Expected behavior
When --fail-on-change is used together with --no-cache it should work.

System information

Linux

$ treefmt --version
treefmt v2.0.2
@brianmcgee
Copy link
Member

@terlar yeah looks like #330 broke this, I'm having a look

@brianmcgee
Copy link
Member

@terlar I have a fix inbound #344

I'll probably cut a new release over the weekend, as there will be a few fixes and improvements.

In the meantime, you can pull in the branch as a flake input and override the package being used.

@terlar
Copy link
Author

terlar commented Jul 6, 2024

I can confirm that this works now, thank you for the quick turnaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants