Skip to content
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

Some way to sort keys :) #32

Closed
AlexBaranosky opened this issue Feb 5, 2014 · 5 comments
Closed

Some way to sort keys :) #32

AlexBaranosky opened this issue Feb 5, 2014 · 5 comments

Comments

@AlexBaranosky
Copy link
Contributor

I love sorting things :)

I'd love a function to sort maps for easier reading.

Also, sorted maps diff better in git when you make test changes. (You may only change things slightly but the way the map prints garbles the whole commit by rearranging the map totally, making it look like more things have changed than eally have changed.)

@ernestas
Copy link

Did you find a way to sort?

@Malabarba
Copy link
Member

Honestly, I think this could go in clojure-mode. Now that it has vertical alignment of values, might be nice to sort keys too. @bbatsov WDYT?

@expez
Copy link
Member

expez commented Jan 11, 2016

Sorting and pretty-printing would be a lot easier to do in the middleware.

@Malabarba
Copy link
Member

I think sorting is simpler in the client. There's nothing complex about sorting key-val pairs alphabetically, so there's no need to add a layer of complexity by involving the server.

Besides, by working directly with the text (instead of sending it back and forth as data) there is less stuff you need to worry about (like accidentally losing/adding metadata, or deleting comments).

@mahinshaw
Copy link

As a note. I have just found the built in sort-lines to be useful here. The only thing I find painful is the delimiters (braces) will get sorted to, so the map pairs need to be on their own lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants