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

Only write to file the formatted code when it is different to the current one #235

Merged

Conversation

gonzalobf
Copy link
Contributor

Fixes #231. I couldn't find any test that checks the writing to but let me know if you think it is needed and I'll try to implement one.

I used stats to check if it works:

$ stat rebar.config | grep -F 'Modify'                                                                                                                                            0s
Modify: 2021-01-06 09:38:08.204419183 +0000
$ _build/release/bin/erlfmt -w "{src,include,test}/*.{hrl,erl}" rebar.config
$ stat rebar.config | grep -F 'Modify'                                                                                                                                            0s
Modify: 2021-01-06 09:38:08.204419183 +0000

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 6, 2021
@kvelicka
Copy link

@michalmuskala any thoughts on this?

@michalmuskala
Copy link
Member

Hi @kvelicka. Thank you so much for your contribution. I'm sorry about the delay.

We've been quite busy the last couple days. I'll get back to you as soon as I can.

@kvelicka
Copy link

Thanks for the quick reply! No worries and no rush, was just making sure that this was on someone's radar.

Credit for the code is all to @gonzalobf too!

@awalterschulze
Copy link
Member

We have decided to merge this as is and created an issue to tackle an optimization #238

@awalterschulze
Copy link
Member

Thank you for bringing this to our attention and fixing it <3

@awalterschulze awalterschulze merged commit 92dafbc into WhatsApp:master Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

erlfmt -w bumps mtime of all files it checks
5 participants