protorepl

2017-02-24T22:40:51.000690Z

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?

2017-02-24T22:54:00.000691Z

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

seancorfield 2017-02-24T23:32:40.000692Z

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

2017-02-24T23:33:25.000693Z

Hah, yes… that is certainly true!

seancorfield 2017-02-24T23:34:23.000694Z

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...

2017-02-24T23:39:27.000695Z

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.

seancorfield 2017-02-24T23:46:49.000696Z

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

seancorfield 2017-02-24T23:47:34.000697Z

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

seancorfield 2017-02-24T23:48:03.000698Z

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

seancorfield 2017-02-24T23:49:03.000699Z

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

seancorfield 2017-02-24T23:49:30.000700Z

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

2017-02-24T23:50:02.000701Z

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