<commit_before>(ns leiningen.light-nrepl
  (:gen-class)
  (:require [leiningen.core.project :as lp]
            [leiningen.repl :as repl]
            [clojure.string :as string]
            [fs.core :as fs])
  (:use [leiningen.core.eval :only [eval-in-project]]))

(defn parse-version [ver]
  (let [[major minor patch] (string/split ver #"\.")
        [patch extra] (string/split patch #"-")]
    {:major (Integer. major)
     :minor (Integer. minor)
     :patch (Integer. patch)}))

(defn valid-clojure? [ver]
  (let [{:keys [major minor patch]} (parse-version ver)]
    ;;do this by negation. It's an invalid version if any of the
    ;;following are true
    (not
     (or (< major 1)
         (and (= major 1) (< minor 5))
         (and (= major 1) (= minor 5) (< patch 1))))))

(defn proj->name [proj]
  (str (:name proj) " " (:version proj)))

(defn prep [project name]
  (let [init `(swap! lighttable.nrepl.core/my-settings merge {:name ~(or name (str (:name project) " " (:version project))) :project (quote ~project)})
        init (if-let [cur-init (-> project :repl-options :init)]
               (list 'do cur-init init)
               init)
        profile {:dependencies '[[lein-light-nrepl/lein-light-nrepl "0.0.10"]
                                 [org.clojure/tools.reader "0.7.10"]]
                 :repl-options {:nrepl-middleware ['lighttable.nrepl.handler/lighttable-ops]
                                 :init (with-meta init {:replace true})}}
        project (lp/merge-profiles project [profile])]
    (println "final project: " (pr-str (:dependencies project)))
      project))

(defn find-clojure-version [proj]<commit_msg>don't freak out if there's no clojure dep<commit_after>(ns leiningen.light-nrepl
  (:gen-class)
  (:require [leiningen.core.project :as lp]
            [leiningen.repl :as repl]
            [clojure.string :as string]
            [fs.core :as fs])
  (:use [leiningen.core.eval :only [eval-in-project]]))

(defn parse-version [ver]
  (when ver
    (let [[major minor patch] (string/split ver #"\.")
          [patch extra] (string/split patch #"-")]
      {:major (Integer. major)
       :minor (Integer. minor)
       :patch (Integer. patch)})))

(defn valid-clojure? [ver]
  (if-not ver
    true
    (let [{:keys [major minor patch]} (parse-version ver)]
      ;;do this by negation. It's an invalid version if any of the
      ;;following are true
      (not
       (or (< major 1)
           (and (= major 1) (< minor 5))
           (and (= major 1) (= minor 5) (< patch 1)))))))

(defn proj->name [proj]
  (str (:name proj) " " (:version proj)))

(defn prep [project name]
  (let [init `(swap! lighttable.nrepl.core/my-settings merge {:name ~(or name (str (:name project) " " (:version project))) :project (quote ~project)})
        init (if-let [cur-init (-> project :repl-options :init)]
               (list 'do cur-init init)
               init)
        profile {:dependencies '[[lein-light-nrepl/lein-light-nrepl "0.0.10"]
                                 [org.clojure/tools.reader "0.7.10"]]
                 :repl-options {:nrepl-middleware ['lighttable.nrepl.handler/lighttable-ops]
                                 :init (with-meta init {:replace true})}}
        project (lp/merge-profiles project [profile])]
    (println "final project: " (pr-str (:dependencies project)))
      project))

(defn find-clojure-version [proj]
{'fraction_non_alphanumeric': 0.16248894131524624, 'fraction_numerical': 0.008257151282807431, 'mean_word_length': 2.371769383697813, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4315602', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1093, 'n_words': 311}