Fork me on GitHub
#announcements
<
2018-11-26
>
danielcompton00:11:11

I've been thinking for a long time and wishing for an opinionated Clojure code formatter. I've started a thread on ClojureVerse with my ideas on building such a tool with the community. I'm interested in other people's thoughts, particularly people involved in tooling. If you think this is a good idea or a bad idea, please let me know on the forums! https://clojureverse.org/t/clj-commons-building-a-standard-code-formatter/3240

vemv01:11:31

IMO: A standard, automatedly-appliable config would be undoubtedly useful, but creating inflexible software is nothing to be proud about. Particularly given Lisp heritage gofmt is cool until you realise a few rules make no sense to you, and trying to fight them would be an uphill battle Rubocop is a better inspiration: has lots of rules, most of them auto-fixable, but nothing prevents you from deviating from them. And the defaults are still massively popular

phil67214:11:32

@ have you had any experience with prettier in JS?

vemv15:11:19

only tangentially, it was a Prettier + TSLint combo

vemv15:11:08

(I liked the latter, much similar to Rubocop. configurable, it can autofix things to be in styles A or B. e.g. always-semicolon, never-semicolon)

guillaume.carbonneau15:11:52

prettier is a time saver when sharing code with others. no more arguing about whitespaces and indentation. I think clojure would benefit from such a tool. Sometimes it’s hard to standardize across environments and different editors.

vemv15:11:40

but you can also can skip arguing with a configurable tool. I specifically recall using Rubocop with a disagreed config in a larger team, but I was like "whatever, I'll code as usual and run the pre-commit hook autoformatter"

danielcompton22:11:12

There is now #formatting for more discussion about this

plexus15:11:19

Video+transcript of a talk I did last month for the Denver Clojure meetup about clojure.zip https://lambdaisland.com/blog/2018-11-26-art-tree-shaping-clojure-zip