<commit_before>(ns leiningen.pallet-release.core)

(defn deep-merge
  "Recursively merge maps."
  [& ms]
  (letfn [(f [a b]
            (if (and (map? a) (map? b))
              (deep-merge a b)
              b))]
    (apply merge-with f ms)))

(defn fail
  "Fail with the given message, msg."
  [msg]
  (throw (ex-info msg {:exit-code 1})))

(defn fail-on-error
  "Fail on a shell error"
  [exit]
  (when (and exit (pos? exit))
    (fail "Shell command failed")))


(def push-repo-fmt
  "https://pbors:${GH_TOKEN}@github.com%s.git")

(defn repo-coordinates
  [{:keys [url] :as project}]
  (when-not (or url (-> project :pallet-release :url))
    (fail "No :url available in project.clj"))
  (if-let [release-url (-> project :pallet-release :url)]
    release-url
    (let [u (java.net.URL. url)]
      (if (= "github.com" (.getHost u))
        (format push-repo-fmt (.getPath u))
        (fail (str "Don't know how to create a pushable git url from"
                   url))))))

(defn release-config
  "Return a pallet release configuration map"
  [project]
  {:url (repo-coordinates project)
   :branch (or (-> project :pallet-release :branch)
               "master")})<commit_msg>Add space to unknown repo format message<commit_after>(ns leiningen.pallet-release.core)

(defn deep-merge
  "Recursively merge maps."
  [& ms]
  (letfn [(f [a b]
            (if (and (map? a) (map? b))
              (deep-merge a b)
              b))]
    (apply merge-with f ms)))

(defn fail
  "Fail with the given message, msg."
  [msg]
  (throw (ex-info msg {:exit-code 1})))

(defn fail-on-error
  "Fail on a shell error"
  [exit]
  (when (and exit (pos? exit))
    (fail "Shell command failed")))


(def push-repo-fmt
  "https://pbors:${GH_TOKEN}@github.com%s.git")

(defn repo-coordinates
  [{:keys [url] :as project}]
  (when-not (or url (-> project :pallet-release :url))
    (fail "No :url available in project.clj"))
  (if-let [release-url (-> project :pallet-release :url)]
    release-url
    (let [u (java.net.URL. url)]
      (if (= "github.com" (.getHost u))
        (format push-repo-fmt (.getPath u))
        (fail (str "Don't know how to create a pushable git url from "
                   url))))))

(defn release-config
  "Return a pallet release configuration map"
  [project]
  {:url (repo-coordinates project)
   :branch (or (-> project :pallet-release :branch)
               "master")})
{'fraction_non_alphanumeric': 0.1634695579649708, 'fraction_numerical': 0.0008340283569641367, 'mean_word_length': 2.6021021021021022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2476741', 'n_tokens_mistral': 865, 'n_tokens_neox': 846, 'n_words': 259}