-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommend a linter for Clojure? #14
Comments
One issue that we'll run into with most Clojure code quality tools (I covered a couple in a blog post) is that they expect a proper Leiningen project setup, since the tools themselves are Leiningen plugins. The one exception that does work is kibit. I run it like this:
As long as the path to the file to check is indicated (and Kibit has been added to the user's |
Kibit sounds interesting, even if it's not a completely traditional linter. We're going to add a "leinify" command to the exercism CLI, so we could point to linters for people who choose to use it. |
kibit is also easy to integrate into emacs: ;; kibit
;; Teach compile the syntax of the kibit output
(require 'compile)
(add-to-list 'compilation-error-regexp-alist-alist
'(kibit "At \\([^:]+\\):\\([[:digit:]]+\\):" 1 2 nil 0))
(add-to-list 'compilation-error-regexp-alist 'kibit)
;; A convenient command to run "lein kibit" in the project to which
;; the current emacs buffer belongs to.
(defun kibit ()
"Run kibit on the current project.
Display the results in a hyperlinked *compilation* buffer."
(interactive)
(compile "lein kibit"))
(defun kibit-current-file ()
"Run kibit on the current file.
Display the results in a hyperlinked *compilation* buffer."
(interactive)
(compile (concat "lein kibit " buffer-file-name))) But as @mathias pointed out, kibit's more about writing 'idiomatic' code than traditional linting... and it is showing its age... was just discussing this on #clojure IRC yesterday. @kytrinyx is there a thread on the FWIW, I liked the lack of a project.clj in the exercises, helped to keep it simple, and removed direct support for 3rd party libs I discussed in #39 |
We have a thread open here: exercism/cli#102 -- it stalled a bit because I got ridiculously busy, but now that there are 3 core contributors to the CLI package, things have been moving more quickly again. |
Ah, gotcha. Just commented there with some suggestions on how to achieve this... it occurs to me after the fact that the lein-template suggestion I made over there would also ease access for exercism-emacs or any other editor packages/tools people wanted to write. |
That would be cool. Anything to lower the barrier to tool-writing seems like a good thing in my book. |
How about adding squiggly-clojure to the default project.clj, it uses Eastwood and core.typed w/ Flycheck to lint as you type... I guess that's mainly of help to emacs users, but I think there are some similar things for other editors. It would be interesting to do a survey of editor usage/preference per-track and across the board... |
I'm down with that. A survey would be interesting... I wonder what the easiest way to implement that would be (external tool, presumably?) |
See exercism/docs#54 for details.
The text was updated successfully, but these errors were encountered: