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

organize phoenix routes like we do with mix configs

Open novaugust opened this issue 10 months ago • 2 comments

  • sort by path, controller, action, dsl_name
  • remove scope which only set a path, and add that path to the children (implicit grouping no longer needed as styler will maintain the grouping)

will probably just ship this as a task that can be run in isolation to start with, letting people use it once and then put things how they want them otherwise

novaugust avatar Apr 23 '24 22:04 novaugust

an example of why we wouldn't want to do this:

      get("/request_anonymization", UserController, :request_anonymization)
      get("/cancel_anonymization", UserController, :cancel_anonymization)

sure, it would've been better if the author had done get "/anonymization/request" but we don't choose the code we inherit ^.^

novaugust avatar Apr 23 '24 22:04 novaugust

Just stumbled across this issue : I personally think this is a good idea, however I think grouping by controller first would be nice - then path, action, dsl_name. Controllers should be a nice heuristic to find related paths, and it solves the problem raised in your comment.

Gladear avatar Aug 10 '24 09:08 Gladear