adobe/elixir-styler

feat: comment directive "sort"

novaugust opened this issue · 5 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!