You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One problem with style guides is that it's often hard to remember all the guidelines
2455
+
and to apply them consistently. We're only humans, after all. Fortunately,
2456
+
there are a bunch of tools that can do most of the work for us.
2457
+
2458
+
TIP: It's a great idea run such tools as part of your continuous integration (CI).
2459
+
This ensure that all the code in one project is consistent with the style you're
2460
+
aiming for.
2461
+
2462
+
=== Lint Tools
2453
2463
2454
2464
There are some lint tools created by the Clojure community that might aid you
2455
2465
in your endeavor to write idiomatic Clojure code.
@@ -2464,6 +2474,19 @@ function or macro.
2464
2474
a wide number of discouraged patterns and suggests improvements, based on this
2465
2475
style guide.
2466
2476
2477
+
=== Code Formatters
2478
+
2479
+
While most Clojure editors and IDEs can format the code, according to the layout guidelines
2480
+
outlined here, it's always handy to have some command-line code formatting tools. There are
2481
+
a couple of options for Clojure that do a great job when it comes to formatting the code
2482
+
as suggested in this guide:
2483
+
2484
+
* https://github.com/weavejester/cljfmt[cljfmt]
2485
+
* https://github.com/kkinnear/zprint[zprint] (the documentation for configuring it to use the community formatting rules is https://github.com/kkinnear/zprint/blob/master/doc/options/community.md[here])
2486
+
2487
+
NOTE: When it comes to editors - Emacs's `clojure-mode` by default will format the code exactly as outlined in the guide.
2488
+
Other editors might require some configuration tweaking to produce the same results.
2489
+
2467
2490
== History
2468
2491
2469
2492
This guide was started in 2013 by https://github.com/bbatsov[Bozhidar Batsov], following the
0 commit comments