Skip to content

Feature Requests: Heredocs/Locals without Parens/HEEx attrs? #88

@sodapopcan

Description

@sodapopcan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions