Fork me on GitHub
#protorepl
<
2017-02-24
>
bsiver22:02:51

Hi all, I’ve setup atom following the instructions in this guide: https://gist.github.com/jasongilman/d1f70507bed021b48625 I have an issue where every time I open a .clj file, one of the plugins is automatically reformatting my code (changing indent levels, moving parens, etc). I’ve tried disabling packages one by one and I can’t seem to find the culprit. Is there an obvious explanation for this?

bsiver22:02:00

Resolved my issue.. the parinfer package was automatically reformatting things even while disabled. Uninstalling it completely resolved the problem.

seancorfield23:02:40

That indicates your code is not formatted in “The Clojure Way” @bsiver 🙂

bsiver23:02:25

Hah, yes… that is certainly true!

seancorfield23:02:23

I’d advise letting Parinfer do its thing and just get used to writing code the way other Clojurians expect to read it. Having a non-standard style will make your code hard to read for others. It will also get you used to reading “standard community style” code elsewhere...

bsiver23:02:27

Can’t say I disagree with you. It was just disconcerting at first to have every file I opened immediately changed, makes diff’ing a little irksome. But in the long term it’d be good to just bulk reformat everything into what Parinfer/the Rest of the World agree with.

seancorfield23:02:49

For a while our team “standard” for code formatting was “whatever Emacs thinks is correct” 🙂

seancorfield23:02:34

Since I switched to ProtoREPL, my stance is “whatever Parinfer thinks is correct”. Just one less thing to worry about.

seancorfield23:02:03

(those two almost exactly coincide — there’s just a handful of places where Parinfer is more opinionated)

seancorfield23:02:03

(try
  (some-thing)
  (catch Exception _
    ;; ignore this
    ))
gets reformatted to this
(try
  (some-thing)
  (catch Exception _))
    ;; ignore this
and I can live with that

seancorfield23:02:30

(if I really cared, I could use (comment ignore this) instead)

bsiver23:02:02

yes, I had a lot of instances of reformatting just like that. Coincidentally the other half of my development team uses emacs 🙂