oakmac / oakmac/standard-clojure-style-js
Rationale for not aligning map values/let bindings
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 137
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
(Continuing from #173 in a new issue)
I asked you at the conj about map value alignment and you said it could be done but you weren't planning to implement it. Also the readme says:
- vertical alignment of
letforms and map literals are allowed
- the choice is up to the author
- [cljfmt option]
:remove-multiple-non-indenting-spaces?= false- I have seen too many code examples where vertical alignment adds clarity
i.e. the formatter allows alignment, but it doesn't enforce alignment. SCS allows this snippet to go through formatting unchanged, for example:
{:first-key 1
:second-key 2
:third-key 3}
This is the other large benefit I've had from zprint. Most of the other Clojure devs in my company have used Cursive with settings enabled for aligning map values (don't remember about let bindings/don't know if Cursive supports that). However I use Vim, which doesn't have any reliable plugin support for doing that. So either I align the values manually (a constant source of friction), or we end up with maps that have partially aligned values (very ugly). zprint's been great since I can just let it do the alignment for me via pre-commit.
So similar to the other issue--obviously I'd love it if you'd be open to implementing map value/let binding alignment, but if not, I'd appreciate an expanded rationale + recommendations for what we should be doing. Should we just allow partially-aligned maps into the codebase? Should we have everyone disable their auto-align-map-forms settings?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the README alignment policy and the discussion continued from issue #173. Review the documented behavior for map values and let bindings, then update the rationale and recommendations so the guidance explains whether partial alignment or disabled auto-alignment is preferred.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, javascript
- Domain
- documentation, tooling
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100