AdRoll / rebar3_format

Erlang Formatter for Rebar3
https://tech.nextroll.com/blog/dev/2020/02/25/erlang-rebar3-format.html
MIT License
109 stars 21 forks source link

Introduce Windows CI, but fixed #268

Open ElectronicRU opened 3 years ago

ElectronicRU commented 3 years ago

Fixes bugs uncovered by #267.

List of changes:

ElectronicRU commented 3 years ago

@paulo-ferraz-oliveira @elbrujohalcon could you take a look? CI fails with some stuff that's non-reproducible to me - it seems like it's improper stup/default, I'm not sure what to make of it.

elbrujohalcon commented 3 years ago

Now, for that CI pipeline… No idea what's going on, but from what git diff is saying…

-        {you_cant, Open} when Open ->
+        throw:{you_cant, Open} when Open ->

The original file doesn't have that throw in there. Why would the formatter be adding it… and why only for Windows? 🤨

It's very strange to me that this happens only in the Windows version. There must be something else that's different here.

elbrujohalcon commented 3 years ago

It might be the erl_syntax version… It seems like, for Windows, the parser sees a class_qualifier in {you_cant, Open} when Open ->. While, in Linux, it parses it just as a tuple. No idea how that happens.

elbrujohalcon commented 3 years ago

Also no idea what's the deal with a.broken.file… maybe it's adding (or subtracting) a newline at the end of it?

ElectronicRU commented 3 years ago

It might be the erl_syntax version… It seems like, for Windows, the parser sees a class_qualifier in {you_cant, Open} when Open ->. While, in Linux, it parses it just as a tuple. No idea how that happens.

I have to imagine that whatever vsn gets installed by gleam is wrong... the escript references "erl10.0" - is that right?

elbrujohalcon commented 3 years ago

I have to imagine that whatever vsn gets installed by gleam is wrong... the escript references "erl10.0" - is that right?

No idea. @paulo-ferraz-oliveira do you know?

paulo-ferraz-oliveira commented 3 years ago

I have to imagine that whatever vsn gets installed by gleam is wrong... the escript references "erl10.0" - is that right?

No idea. @paulo-ferraz-oliveira do you know?

Let me check (I think I've ran into this issue before).

paulo-ferraz-oliveira commented 3 years ago

So, https://github.com/gleam-lang/setup-erlang/blob/main/main.ps1#L4 seems to convert 21.3 to 21. We might just have to open an issue next to setup-erlang. Let me do that.

Edit: https://github.com/gleam-lang/setup-erlang/issues/10

ElectronicRU commented 3 years ago

Would it be acceptable to bump gleam's version to 22 for now?

paulo-ferraz-oliveira commented 3 years ago

I'm pretty sure 22 has no pre-compiled Windows versions (on the Erlang Solutions repo.), which is why I chose 21.3, but you can always try again, here, and we can BE sure 🤣 (I looked around and couldn't find a reference to where I state 22 isn't available - since I trust past-me).

paulo-ferraz-oliveira commented 3 years ago

@ElectronicRU, any news on this? I'd like to test an update to the Windows CI, but would prefer to do it on an already working version 😄 Thanks.

ElectronicRU commented 3 years ago

@paulo-ferraz-oliveira Sorry, haven't been able to work on this - and honestly, I have a little clue as anyone at this point. :(

paulo-ferraz-oliveira commented 3 years ago

Sure. I'll close my pull request, then, since this seems to be stalled. We can reopen later if required.