Permalink
Browse files

Merge pull request #179 from arrdem/master

Migrate to the allmighty monorepode
  • Loading branch information...
2 parents 66b20f1 + 07384e2 commit 4be4b52222b6bc5070696e06a3f0f8f5ecea2c47 @danielcompton danielcompton committed on GitHub Mar 22, 2017
Showing with 86 additions and 3 deletions.
  1. +3 −1 .gitignore
  2. +10 −1 .travis.yml
  3. +1 −0 kibit-common/resources/jonase/kibit/VERSION
  4. +6 −1 { → kibit}/project.clj
  5. 0 { → kibit}/src/kibit/check.clj
  6. 0 { → kibit}/src/kibit/core.clj
  7. 0 { → kibit}/src/kibit/driver.clj
  8. 0 { → kibit}/src/kibit/monkeypatch.clj
  9. 0 { → kibit}/src/kibit/replace.clj
  10. 0 { → kibit}/src/kibit/reporters.clj
  11. 0 { → kibit}/src/kibit/rules.clj
  12. 0 { → kibit}/src/kibit/rules/arithmetic.clj
  13. 0 { → kibit}/src/kibit/rules/collections.clj
  14. 0 { → kibit}/src/kibit/rules/control_structures.clj
  15. 0 { → kibit}/src/kibit/rules/equality.clj
  16. 0 { → kibit}/src/kibit/rules/misc.clj
  17. 0 { → kibit}/src/kibit/rules/util.clj
  18. 0 { → kibit}/test/kibit/test/arithmetic.clj
  19. 0 { → kibit}/test/kibit/test/check.clj
  20. 0 { → kibit}/test/kibit/test/collections.clj
  21. 0 { → kibit}/test/kibit/test/control_structures.clj
  22. 0 { → kibit}/test/kibit/test/core.clj
  23. 0 { → kibit}/test/kibit/test/driver.clj
  24. 0 { → kibit}/test/kibit/test/equality.clj
  25. 0 { → kibit}/test/kibit/test/misc.clj
  26. 0 { → kibit}/test/kibit/test/replace.clj
  27. 0 { → kibit}/test/kibit/test/reporters.clj
  28. 0 { → kibit}/test/resources/first.clj
  29. 0 { → kibit}/test/resources/fourth.txt
  30. 0 { → kibit}/test/resources/second.cljx
  31. 0 { → kibit}/test/resources/sets.clj
  32. 0 { → kibit}/test/resources/third.cljs
  33. +13 −0 lein-kibit/.gitignore
  34. +14 −0 lein-kibit/README.md
  35. +9 −0 lein-kibit/project.clj
  36. +30 −0 lein-kibit/src/leiningen/kibit.clj
View
@@ -3,6 +3,7 @@ pom.xml
pom.xml.asc
*jar
*.class
+/**/target
# Leiningen
/classes
@@ -14,8 +15,9 @@ pom.xml.asc
.lein-failures
.lein-env
.lein-repl-history
+.nrepl-port
-# Temp Files
+# Temp Filest
*.orig
*~
.*.swp
View
@@ -1,5 +1,14 @@
language: clojure
-script: "lein do clean, test, clean, compile :all"
+install:
+- "pushd kibit"
+- "lein deps"
+- "popd"
+- "pushd lein-kibit"
+- "lein deps"
+- "popd"
+script:
+- "pushd kibit"
+- "lein test-all"
jdk:
- openjdk7
- oraclejdk7
@@ -0,0 +1 @@
+0.1.4-SNAPSHOT
@@ -1,4 +1,4 @@
-(defproject jonase/kibit "0.1.4-SNAPSHOT"
+(defproject jonase/kibit (slurp "../kibit-common/resources/jonase/kibit/VERSION")
:description "There's a function for that!"
:url "https://github.com/jonase/kibit"
:license {:name "Eclipse Public License - v 1.0"
@@ -12,4 +12,9 @@
:profiles {:dev {:dependencies [[lein-marginalia "0.9.0"]]
:resource-paths ["test/resources"]}}
:deploy-repositories [["releases" :clojars]]
+ :aliases {"test-all" ["do"
+ ["clean"]
+ ["test"]
+ ["clean"]
+ ["compile" ":all"]]}
:warn-on-reflection false)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,13 @@
+.*.swp
+/target
+/lib
+/classes
+/checkouts
+pom.xml
+pom.xml.asc
+*.jar
+*.class
+.lein-deps-sum
+.lein-failures
+.lein-plugins
+.lein-repl-history
View
@@ -0,0 +1,14 @@
+# lein-kibit
+
+See [kibit](https://github.com/jonase/kibit) for instructions on how
+to install and use this plugin.
+
+## Development
+
+When updating to a new Kibit version, make sure to update both the `project.clj`, and the jonase/kibit dependency in `src/leiningen/kibit.clj`.
+
+## License
+
+Copyright © 2012 Jonas Enlund
+
+Distributed under the Eclipse Public License, the same as Clojure.
@@ -0,0 +1,9 @@
+(defproject lein-kibit (slurp "../kibit-common/resources/jonase/kibit/VERSION")
+ :description "kibit lein plugin"
+ :url "https://github.com/jonase/lein-kibit"
+ :resource-paths ["../kibit-common/resources"]
+ :license {:name "Eclipse Public License"
+ :url "http://www.eclipse.org/legal/epl-v10.html"}
+ :dependencies [[org.clojure/tools.namespace "0.2.11"]]
+ :deploy-repositories [["releases" :clojars]]
+ :eval-in-leiningen true)
@@ -0,0 +1,30 @@
+(ns leiningen.kibit
+ (:require [leiningen.core.eval :refer [eval-in-project]]
+ [clojure.tools.namespace.find :refer [find-namespaces]]
+ [clojure.java.io :as io]))
+
+
+(defn ^:no-project-needed kibit
+ [project & args]
+ (let [src-paths (get-in project [:kibit :source-paths] ["rules"])
+ kibit-project `{:dependencies [[jonase/kibit ~(slurp
+ (io/resource
+ "jonase/kibit/VERSION"))]]
+ :source-paths ~src-paths}
+ paths (filter some? (concat
+ (:source-paths project)
+ [(:source-path project)]
+ (mapcat :source-paths (get-in project [:cljsbuild :builds]))
+ (mapcat :source-paths (get-in project [:cljx :builds]))))
+ rules (get-in project [:kibit :rules])
+ src `(kibit.driver/external-run '~paths
+ (when ~rules
+ (apply concat (vals ~rules)))
+ ~@args)
+ ns-xs (mapcat identity (map #(find-namespaces [(io/file %)]) src-paths))
+ req `(do (require 'kibit.driver)
+ (doseq [n# '~ns-xs]
+ (require n#)))]
+ (try (eval-in-project kibit-project src req)
+ (catch Exception e
+ (throw (ex-info "" {:exit-code 1}))))))

0 comments on commit 4be4b52

Please sign in to comment.