-
Notifications
You must be signed in to change notification settings - Fork 35
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
Pinned variables in matches are formatted incorrectly #27
Comments
just when you think you've seen all the ways people write ecto queries 😂
yeah, i'll add pin as a valid start as well |
Yeah I find stuff like this relatively often. 😅 |
if it makes your life easier, all i ever need is the snippet that does weird things for you, to save you the work of blacking out screenshots. can just write ^foo
|> Ecto.Query.blah(...) |
want to just point at latest main here on GH until you stop finding issues? i can cut a release after that ^.^ |
Alright, I've tested There were a few times where a format would cause code to not compile or tests to fail, but each of those cases were actually good opportunities for refactoring that I was able to fix! I look forward to trying this as more of the items from #18 are added. 😄 |
The only thing I'm aware of breaking compilation is when there are |
Nope! Just stuff like: alias Some.Long.Path
use Path.Thing And even worse: (this was technically only a compiler warning, but still) @some_module_attribute :thing
use Some.Weird.Macro # depends on @some_module_attribute being defined So now I've changed those to: use Some.Long.Path.Thing
alias Some.Long.Path And: # using actual __using__ opts instead of module attributes
use Some.Weird.Macro,
some_module_attribute: :thing 😄 |
yep, that's 100% the problems i see on first run as well. thanks! |
thanks again for the issues & feedback. kicked out |
Elixir / OTP Version
Using
elixir-styler
version 0.5.2.Current Behaviour
Example 1:

Which gives:
If I revert and rerun

mix format
, there is a different result that is still weird:Example 2:

Oddly enough, if I revert the file and then rerun
mix format
, this same code is untouched. 🤔I'm guessing that the non-deterministic behavior is not intended either, though that's probably a separate issue? 😅
Expected Behaviour
Unsure what should actually happen here, but perhaps pinned variables should be ignored?
The text was updated successfully, but these errors were encountered: