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

Discards lexical , #67

Open
arrdem opened this Issue Mar 18, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@arrdem
Contributor

arrdem commented Mar 18, 2016

It should be possible to use leading , to force indentation. cljfmt currently strips leading , leading to unexpected changes in indentation.

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Mar 28, 2016

Contributor

This is due to the treatment of , as simple whitespace by rewrite-clj, currently being addressed over there in xsc/rewrite-clj#44

Contributor

arrdem commented Mar 28, 2016

This is due to the treatment of , as simple whitespace by rewrite-clj, currently being addressed over there in xsc/rewrite-clj#44

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Apr 3, 2016

Contributor

[rewrite-clj "0.5.0"] brings :comma nodes which makes this more tractable. https://github.com/xsc/rewrite-clj/releases/tag/clojars-0.5.0

Contributor

arrdem commented Apr 3, 2016

[rewrite-clj "0.5.0"] brings :comma nodes which makes this more tractable. https://github.com/xsc/rewrite-clj/releases/tag/clojars-0.5.0

@MatthewDarling

This comment has been minimized.

Show comment
Hide comment
@MatthewDarling

MatthewDarling Dec 21, 2017

Contributor

Looking at the linked examples, it looks like you want to keep commas when they're the first non-whitespace character on the line.

And anywhere else, removing them is fine?

Contributor

MatthewDarling commented Dec 21, 2017

Looking at the linked examples, it looks like you want to keep commas when they're the first non-whitespace character on the line.

And anywhere else, removing them is fine?

@arrdem

This comment has been minimized.

Show comment
Hide comment
@arrdem

arrdem Dec 22, 2017

Contributor

So I use ,, as a line prefix in require/import forms since none of the indenters happen to understand or format prefix lists meaningfully and that trick happens to work in CIDER. Same thing for cond and other forms which have consecutive pairs that are not typically block indented when on different lines.

In general, I'm not sure that cljfmt should be removing commas when they occur.

Contributor

arrdem commented Dec 22, 2017

So I use ,, as a line prefix in require/import forms since none of the indenters happen to understand or format prefix lists meaningfully and that trick happens to work in CIDER. Same thing for cond and other forms which have consecutive pairs that are not typically block indented when on different lines.

In general, I'm not sure that cljfmt should be removing commas when they occur.

@arrdem arrdem referenced this issue Jan 24, 2018

Merged

formatting tweaks to satisfy cljfmt in CI #485

0 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment