Closed wingyplus closed 2 years ago
Hi,
I'm working on erlfmt_formatter_plugin which's bridge between mix formatter plugin and erlfmt. I found out that the erlfmt:format_string/2 doesn't allow to set filename (https://github.com/WhatsApp/erlfmt/blob/main/src/erlfmt.erl#L132), this cause the formatter plugin display filename as nofile when combining with erlfmt:format_error_info.
erlfmt:format_string/2
nofile
erlfmt:format_error_info
My proposal is allow erlfmt:format_string/2 to accept filename as an options and default to nofile when it doesn't set. I can open a PR to implement this.
What do you think?
Yeah, that sounds reasonable. PR is definitely welcome
PR opened ☝️
Hi,
I'm working on erlfmt_formatter_plugin which's bridge between mix formatter plugin and erlfmt. I found out that the
erlfmt:format_string/2
doesn't allow to set filename (https://github.com/WhatsApp/erlfmt/blob/main/src/erlfmt.erl#L132), this cause the formatter plugin display filename asnofile
when combining witherlfmt:format_error_info
.My proposal is allow
erlfmt:format_string/2
to accept filename as an options and default tonofile
when it doesn't set. I can open a PR to implement this.What do you think?