Clojure code static analysis tools

前端 未结 2 601
甜味超标
甜味超标 2021-02-15 10:15

Is there a tool to run code convention tests in clojure? For example, make sure function names don\'t have any capital letters or keywords don\'t have any underscores in them.<

相关标签:
2条回答
  • 2021-02-15 10:45

    Late to the party here. Seconding noahlz, the three main static analysis tools that I use on a regular basis are lein-bikeshed, lein-kibit, and Eastwood, though I also use yagni. Each of these has different strengths.

    Bikeshed is good for general code cleanup but is mostly focused on style (e.g. making sure lines aren't too long, there's no trailing whitespace, functions have docstrings, etc.).

    Kibit is good for showing you the most idiomatic function to use (for instance, when using an if form that returns nil if false, you could just use when instead).

    Eastwood is probably the most comprehensive lint tool that exists for Clojure, and checks for a pretty impressive number of code smell issues.

    Finally, Yagni is great for finding unused code paths in your libraries and applications.

    0 讨论(0)
  • 2021-02-15 10:54

    Two useful Leiningen plugins I learned about recently:

    • lein-bikeshed
    • lein-kibit
    0 讨论(0)
提交回复
热议问题