Skip to content

cue fmt always writes to the files #140

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

Open
zimbatm opened this issue Dec 17, 2021 · 2 comments
Open

cue fmt always writes to the files #140

zimbatm opened this issue Dec 17, 2021 · 2 comments
Labels
bug Something isn't working formatter Issue specific to a formatter

Comments

@zimbatm
Copy link
Member

zimbatm commented Dec 17, 2021

Describe the bug

cue fmt doesn't respect the treefmt spec and writes to the file, even if no changes occurred in the formatting.

To Reproduce

Run cue fmt somefile.cue && stat somefile.cue twice and see that the timestamp has changed twice.

Expected behavior

No change.

Additional context

This seems to be a known issue with Cue already: cue-lang/cue#363

@zimbatm zimbatm added the bug Something isn't working label Dec 17, 2021
@zimbatm
Copy link
Member Author

zimbatm commented Dec 20, 2021

I wanted to fix upstream but at the point where the config is written back, the code has only an AST available. I think the AST would have to somehow be extended to carry a "modified" flag.

dermetfan referenced this issue in input-output-hk/cicero Apr 12, 2022
@zimbatm zimbatm added the formatter Issue specific to a formatter label Oct 2, 2022
@brianmcgee
Copy link
Member

@zimbatm is this something we still need to address?

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

No branches or pull requests

2 participants