<commit_before>(ns yetibot.core.commands.config
  (:require
    [clojure.pprint :refer [pprint]]
    [yetibot.core.hooks :refer [cmd-hook]]
    [yetibot.core.config :as config]))

(defn lookup-config
  "config <path> # lookup config by path"
  [{:keys [match]}]
  (prn "match" match)
  (let [frags (map (comp keyword first) (re-seq #"([\-\w]+)+" match))
        frags (if (= :yetibot (first frags)) frags (into [:yetibot] frags))
        conf (apply config/get-config frags)]
    (if conf
      (with-out-str (pprint conf))
      (str "Couldn't find config at " match))))

(cmd-hook #"config"
          #"\w+[\s\w]*" lookup-config)<commit_msg>Disable config command; makes it too easy for anyone to look at sensative info<commit_after>(ns yetibot.core.commands.config
  (:require
    [clojure.pprint :refer [pprint]]
    [yetibot.core.hooks :refer [cmd-hook]]
    [yetibot.core.config :as config]))

(defn lookup-config
  "config <path> # lookup config by path"
  [{:keys [match]}]
  (prn "match" match)
  (let [frags (map (comp keyword first) (re-seq #"([\-\w]+)+" match))
        frags (if (= :yetibot (first frags)) frags (into [:yetibot] frags))
        conf (apply config/get-config frags)]
    (if conf
      (with-out-str (pprint conf))
      (str "Couldn't find config at " match))))

; (cmd-hook #"config"
;           #"\w+[\s\w]*" lookup-config)
{'fraction_non_alphanumeric': 0.17785977859778598, 'fraction_numerical': 0.0, 'mean_word_length': 3.2111801242236027, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5269656', 'n_tokens_mistral': 512, 'n_tokens_neox': 498, 'n_words': 136}