samply / blaze

A FHIR® Server with internal, fast CQL Evaluation Engine
https://samply.github.io/blaze
Apache License 2.0
148 stars 18 forks source link

development improvement: shared clojure formatting #67

Open drewverlee opened 4 years ago

drewverlee commented 4 years ago

Greetings.

Problem

My editors Clojure formatting rules are different then how the project is setup. This can lead to more lines being changed in a file then is necessary.

Solution

Would it be possible to share a formatter among different editors? emacs, intelliji, etc..? Or maybe at least document how the formatting is done so we could build individual solutions?

Thanks!

alexanderkiel commented 4 years ago

In IntelliJ with Cursive I use the following settings under Editor > Code Style > Clojure:

Tabs and Idents

[ ] Use tab character Tab size: 2 Ident: 2

General

[ ] Align let-binding values [x] Align reader conditional values [ ] Align map values Comment alignment column: 60 [ ] Default to Only Indent [x] Use vectors for import class clauses [ ] One space list indent Docstring fill width: 80

Form Parameters

Various settings. I prefer to only indent macros.

Line width is 80. I prefer to break down everything or nothing. So if I have to break, I break every form (not very consistent yet).

We may use cljfmt or something similar.