Skip to content

Instantly share code, notes, and snippets.

@galdolber galdolber/loc.clj
Created Mar 28, 2014

Embed
What would you like to do?
LOC metrics in clojure
(use '[clojure.java.io])
(defn walk [dirpath pattern]
(doall (filter #(re-matches pattern (.getName %))
(file-seq (file dirpath)))))
(->> (walk "src" #".*\.clj")
(map #(with-open [rdr (reader (file (.getPath %)))]
(count (line-seq rdr))))
(reduce +))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.