-
Notifications
You must be signed in to change notification settings - Fork 196
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
Race conditions in SourceFile.formatter_opts #402
Comments
I copied this from discord, but I'm posting it here as I think it is more relevant:
So my question mainly revolves around whether or not there may be a stop-gap in here, e.g if |
I'm not sure that silently skipping the formatting step would be a good behavior because it would be reporting that a file is formatted when it is not formatted, which in my opinion is worse than formatting with default options. Perhaps instead we could mark the request as failed, although I'm not sure exactly how that would manifest to users. I have started working on a PR to elixir that would allow us to pass in a root path to |
Yeah, I think some kind of failure would be the simplest answer. Even if we fix this particular issue, I think it's important to note that formatting with default options can theoretically be destructive given that we have formatted plugins now. So IMO we still want the behavior that if anything goes wrong getting the formatter opts we should fail to format. |
* Use formatter_for_file instead of formatter_opts_for_file which is deprecated now * Fallback to original Code.format_string! Co-authored-by: Dalibor Horinek <[email protected]>
Addressed in #890 |
When pwd is changing by the build in the background,
SourceFile.formatter_opts
crashes with various exceptions (see #318, #401). We rescue them but this only hides the real issue. The proper fix would be to use a cache with build lock. Example solution fixing only formatter issues is proposed in #394The text was updated successfully, but these errors were encountered: