elixir-styler icon indicating copy to clipboard operation
elixir-styler copied to clipboard

feat: comment directive "sort"

Open novaugust opened this issue 1 year ago • 0 comments

Often there's a series of ast siblings that codebase authors want to keep sorted. We know this to be the case for things like aliases, imports, etc, but what about arbitrary lists within the code? The author just has to put a comment like "please keep this sorted :(" and hope their coworkers play along.

But the whole point of styler is saving you from having to think about your coworkers preferences! (this is a joke. sort of.)

So maybe it could maintain this for us?

Example Input

# given
@my_list [
  # styler:sort
  :a,
  :quick,
  :brown,
  :fox
]
# get
@my_list [
  # styler:sort
  :a,
  :brown,
  :fox,
  :quick
]

could be neat!

novaugust avatar May 16 '24 17:05 novaugust