-
Notifications
You must be signed in to change notification settings - Fork 123
Align forms and maps #370
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
base: master
Are you sure you want to change the base?
Align forms and maps #370
Conversation
Note that it's still a draft PR, and has very little testing yet (except the beefed-up test suite). So play around, but not ready for anything serious yet. Needs more testing in production codebases, and more test cases to cover edge cases. I'd prefer the blessing of the original author @reutsharabani if this is to be taken forward, since he's done the heavy lifting. also needs to be rebased on master of course. |
like for map- or vector-destructuring; add whitespace between the top forms and not inside the vector (ie in `[[a b] (foo)]` or `[{:keys [a b]} (baz)]`)
3dc2591
to
25e1f17
Compare
Most of the work here was done by weavejester. I expect he is very busy but hopefullyyou can make it happen! And I am a she not a he :) |
I've had a lull in my work, so this PR came at the right time to encourage me to return to this. I'm currently working on the align-maps branch of this repository, and the work done on all the tests here has been invaluable. The branch is currently mostly working. I'm currently in the middle of porting all the tests over and fixing any issues they raise. I'll be spending a few days on this so I'm hoping to put this issue finally to rest. Thanks again to everyone who contributed. |
Correctly align maps and forms with columnar layout.
Enable with
:align-maps? true
and:align-forms? true
in.cljfmt.clj
config file.Based almost entirely on the great work by
reutsharabani
in his two PRs:reutsharabani#1
reutsharabani#3
With a sprinkle of magic dust on top to fix null pointer exceptions and whitespace issues for complex binding forms like map and vector:
(let [{:keys [a b]} (foo)] ...)
and
(let [[a b] (foo)] ...)