Conversation
Rich comments are often used as a scratchpad where forms are added and removed frequently. Allowing the closing parenthesis to be placed on a new line, aligned with the indentation of the block, makes these edits cleaner and keeps the diffs focused on the actual code changes. This commit adds the :indent-rich-comments? option, which: - Ensures a trailing newline exists in rich comments when enabled. - Prevents the removal of this newline during whitespace cleanup. - Aligns the closing parenthesis with the block's indentation. Fixes weavejester#365.
e1a9437 to
1cab794
Compare
|
This option should default to I'm also unsure if this is the right way to go about this feature. Let me give it some thought, but my initial idea is it might be worth having a list of forms that ignore certain rules. |
|
we could have something like: {:rule-exceptions {comment #{:gather-trailing-parens}}}what do you think? |
|
Over the years I personally got used to this syntax: It's just an extra globally interned keyword (if you are inaccurate to eval it), otherwise a no-op that achieves the same goal for rich-comment blocks, plays nicely with tooling (both linters and formatters) and has a low potential to piss off one's colleagues. I saw people doing different other similar things, e.g.: but I found that either lacking clear, obvious semantics and/or not being able to play nicely with this or that tooling. |
Rich comments are often used as a scratchpad where forms are added and removed frequently. Allowing the closing parenthesis to be placed on a new line, aligned with the indentation of the block, makes these edits cleaner and keeps the diffs focused on the actual code changes.
This commit adds the :indent-rich-comments? option, which:
Fixes #365.