-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: comment directive "sort" #167
Comments
I like to sort my deps alphabetically, so this might be helpful there, too. |
@zimt28 should be! you could take styler def deps do
# styler:sort
[
{:styler, github: "adobe/elixir-styler"},
...
]
end |
It doesn't work quite right yet, this is the order it produces: defp deps do
# styler:sort
[
{:styler, github: "adobe/elixir-styler"},
{:ash, "~> 3.0"},
{:ash_phoenix, "~> 2.0"},
{:ash_postgres, "~> 2.0"},
{:bandit, "~> 1.5"},
{:dns_cluster, "~> 0.1.1"},
{:ecto_sql, "~> 3.10"},
{:finch, "~> 0.13"},
{:gettext, "~> 0.20"},
{:heroicons,
github: "tailwindlabs/heroicons", tag: "v2.1.1", sparse: "optimized", app: false, compile: false, depth: 1},
{:igniter, "~> 0.1"},
{:jason, "~> 1.2"},
{:phoenix, "~> 1.7.14"},
{:phoenix_ecto, "~> 4.5"},
{:phoenix_html, "~> 4.1"},
{:phoenix_live_dashboard, "~> 0.8.3"},
# TODO bump on release to {:phoenix_live_view, "~> 1.0.0"},
{:postgrex, ">= 0.0.0"},
{:swoosh, "~> 1.5"},
{:telemetry_metrics, "~> 1.0"},
{:telemetry_poller, "~> 1.0"},
{:phoenix_live_view, "~> 1.0.0-rc.1", override: true},
{:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
{:floki, ">= 0.30.0", only: :test},
{:fluxon, "~> 1.0.0", repo: :fluxon},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
{:tailwind_formatter, "~> 0.4", only: [:dev, :test], runtime: false}
]
end Also, it would be nice if it could move along comments above entries |
ah thanks, will address the tuple issues and the comments (thanks for the reminder) before releasing :) |
tuples will sort properly with the latest commit, 411cc93 will take a stab at comments sometime in the next week, they're always tricky |
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
could be neat!
The text was updated successfully, but these errors were encountered: