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

an exception erases source file #267

Closed
s-trooper opened this issue Jul 3, 2018 · 3 comments · Fixed by #268
Closed

an exception erases source file #267

s-trooper opened this issue Jul 3, 2018 · 3 comments · Fixed by #268

Comments

@s-trooper
Copy link
Contributor

if target buffer is the same as source and the formatter throws an error, then the target and the source are empty and the original source will be lost.
to mitigate this problem there are a --force argument but this is by default false.

  1. it is counter intuitive that per default the files are erased.
    could --force be set to true per default?
  2. why an extra argument at all? i don't see any user case that should allows formatter to destroy source files.
    could --force argument be removed and the original source be kept in the exception case?

P.S: i will make PR for case 1. but honestly i would prefer 2.

@s-trooper s-trooper mentioned this issue Jul 3, 2018
@jindraivanek
Copy link
Contributor

Agree with 2.

@nojaf
Copy link
Contributor

nojaf commented Jul 6, 2018

I'm also in favor of 2.
Vote +1 for option 1, Hooray for option 2 and -1 if you don't agree.

@vasily-kirichenko
Copy link
Contributor

Fixed via #268

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

Successfully merging a pull request may close this issue.

4 participants