-
Notifications
You must be signed in to change notification settings - Fork 47
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
dfmt erase the file when it fails to format it #568
Comments
are you working with |
WebFreak001
added a commit
to WebFreak001/dfmt
that referenced
this issue
Oct 5, 2022
Now when an error in formatting happens, it never outputs anything and doesn't override the file when working inplace. Additionally dfmt is no longer able to fail in the middle of a file, as now we first write everything to a buffer and only if everything was successful, that buffer is printed to stdout or written to the inplace file. This should also guard against segfaults with inplace file formatting erasing parts of the file, as well as the user thinking it was successful, even though dfmt didn't finish properly.
WebFreak001
added a commit
to WebFreak001/dfmt
that referenced
this issue
Oct 5, 2022
Now when an error in formatting happens, it never outputs anything and doesn't override the file when working inplace. Additionally dfmt is no longer able to fail in the middle of a file, as now we first write everything to a buffer and only if everything was successful, that buffer is printed to stdout or written to the inplace file. This should also guard against segfaults with inplace file formatting erasing parts of the file, as well as the user thinking it was successful, even though dfmt didn't finish properly.
WebFreak001
added a commit
to WebFreak001/dfmt
that referenced
this issue
Oct 5, 2022
Now when an error in formatting happens, it never outputs anything and doesn't override the file when working inplace. Additionally dfmt is no longer able to fail in the middle of a file, as now we first write everything to a buffer and only if everything was successful, that buffer is printed to stdout or written to the inplace file. This should also guard against segfaults with inplace file formatting erasing parts of the file, as well as the user thinking it was successful, even though dfmt didn't finish properly.
WebFreak001
added a commit
to WebFreak001/dfmt
that referenced
this issue
Oct 5, 2022
Now when an error in formatting happens, it never outputs anything and doesn't override the file when working inplace. Additionally dfmt is no longer able to fail in the middle of a file, as now we first write everything to a buffer and only if everything was successful, that buffer is printed to stdout or written to the inplace file. This should also guard against segfaults with inplace file formatting erasing parts of the file, as well as the user thinking it was successful, even though dfmt didn't finish properly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If a source file is not formatted correctly then dfmt sometimes erases the content of the file
File sample
The .editconfig used
The text was updated successfully, but these errors were encountered: