Skip to content

Don't touch files whose contents don't change #127

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

Closed
Janamou opened this issue Jan 9, 2015 · 3 comments
Closed

Don't touch files whose contents don't change #127

Janamou opened this issue Jan 9, 2015 · 3 comments

Comments

@Janamou
Copy link

Janamou commented Jan 9, 2015

If the file is already formatted according to dart style guide, it is changed next time even there was not any change.

I then have this for every file when committing:
1 file changed, 0 insertions(+), 0 deletions(-)

@munificent
Copy link
Member

If you run the formatter once, and then run it again on the output of the first run, you should get the same thing back. Is that not what you're seeing? If so, can you give me some details on which code gets modified?

Or is that the file contents are the same, but the modification time is still being touched?

@Janamou
Copy link
Author

Janamou commented Jan 9, 2015

Yes, I understand this. It is the second case.
I am running it with -w parameter to directly update files (for example on lib folder):

dartformat -w lib

And in that moment ALL files in lib folder are updated even nothing was changed (modification time is updated and then Git thinks that there was a change).

Btw, great tool. Thanks for it! :-)

@munificent
Copy link
Member

Yes, I understand this. It is the second case.

Ah, excellent. That is indeed something the formatter should be smarter about. I'll leave this bug open for that until I get a chance to fix it.

Thanks!

@munificent munificent changed the title Changing of already formatted files Don't touch files whose contents don't change Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants