<commit_before>(ns fhofherr.simple.core.dsl
  "Functions and macros required to define a Simple CI project in a `simple.clj`
  project definition file. All public functions in this namespace are available
  from within the `simple.clj` project definition file."
  (:require [clojure.java.shell :refer [sh]]
            [fhofherr.simple.core [config :as config]
             [job-descriptor :as jobs]
             [job-execution-context :as ex-ctx]
             [job-fn :as job-fn]]))

(defn- references-to-map
  [references]
  (reduce (fn [m vs] (assoc m (first vs) (rest vs))) {} references))

(defn- map-to-references
  [ref-map]
  (map (fn [[k v]] (cons k v)) ref-map))

(defn- require-dsl
  [ref-map]
  (let [orig-require (:require ref-map [])
        imports-dsl? (some #(= 'fhofherr.simple.core.dsl (first %)) orig-require)
        new-require (if imports-dsl?
                      orig-require
                      (conj orig-require ['fhofherr.simple.core.dsl :refer :all]))]
    (assoc ref-map :require new-require)))

(defmacro defci
  "Configure your Simple CI environment. Defines a namespace whose name is set
  to [[config/config-ns-name]]. You can use `:require`, `:import`, and
  `:refer-clojure` just as you would in a normal namespace."
  [& references]
  (let [new-refs (-> references<commit_msg>Document core.dsl.<commit_after>(ns fhofherr.simple.core.dsl
  "Functions and macros required to configure Simple CI in a `simple.clj` file.
  All public functions in this namespace are available from within the
  `simple.clj` file."
  (:require [clojure.java.shell :refer [sh]]
            [fhofherr.simple.core [config :as config]
             [job-descriptor :as jobs]
             [job-execution-context :as ex-ctx]
             [job-fn :as job-fn]]))

(defn- references-to-map
  [references]
  (reduce (fn [m vs] (assoc m (first vs) (rest vs))) {} references))

(defn- map-to-references
  [ref-map]
  (map (fn [[k v]] (cons k v)) ref-map))

(defn- require-dsl
  [ref-map]
  (let [orig-require (:require ref-map [])
        imports-dsl? (some #(= 'fhofherr.simple.core.dsl (first %)) orig-require)
        new-require (if imports-dsl?
                      orig-require
                      (conj orig-require ['fhofherr.simple.core.dsl :refer :all]))]
    (assoc ref-map :require new-require)))

(defmacro defci
  "Configure your Simple CI environment. Defines a namespace whose name is set
  to [[config/config-ns-name]]. You can use `:require`, `:import`, and
  `:refer-clojure` just as you would in a normal namespace."
  [& references]
  (let [new-refs (-> references
{'fraction_non_alphanumeric': 0.1395528141865844, 'fraction_numerical': 0.0, 'mean_word_length': 2.804985337243402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '5503942', 'n_tokens_mistral': 875, 'n_tokens_neox': 860, 'n_words': 264}