Hey hey, thanks for Recode! I started writing some of these rules myself before I remember it existed (d'oh).
These are merely suggestions based on my top annoyances that were not covered by Recode. I'm happy to take the implementation of any of them.
-
Indent heredocs at the same level as their sigil.
There are some considerations here as you can't blindly re-indent everything. I feel the safest is to assume that if the first line is indented to far then reduce everything below it by the same amount (unless it "reverse-overflows").
-
Remove parens from :locals_without_parens.
I'm not entirely sure this is possible to reliably identify everything in their proper files. There is Mix.Tasks.Format.formatter_for_file/2 though I haven't played around with it too much and seems to return the same results for every file.
-
Correct if foo == bar, do: true, else: false to foo == bar
-
Correct boolean={true} HEEx attribute to simply boolean
Not sure if you would want to get HEEx involved but the above always annoys me when I see it.
Hey hey, thanks for Recode! I started writing some of these rules myself before I remember it existed (d'oh).
These are merely suggestions based on my top annoyances that were not covered by Recode. I'm happy to take the implementation of any of them.
Indent heredocs at the same level as their sigil.
There are some considerations here as you can't blindly re-indent everything. I feel the safest is to assume that if the first line is indented to far then reduce everything below it by the same amount (unless it "reverse-overflows").
Remove parens from
:locals_without_parens.I'm not entirely sure this is possible to reliably identify everything in their proper files. There is
Mix.Tasks.Format.formatter_for_file/2though I haven't played around with it too much and seems to return the same results for every file.Correct
if foo == bar, do: true, else: falsetofoo == barCorrect
boolean={true}HEEx attribute to simplybooleanNot sure if you would want to get HEEx involved but the above always annoys me when I see it.