From 3989bf6fbbb242ad5bd6a1d1f91f70a6a222f8e2 Mon Sep 17 00:00:00 2001 From: eltrac Date: Tue, 13 Oct 2026 21:27:29 +0800 Subject: style: cljfmt everything --- scripts/ci/coverage_badge.clj | 36 ++++++++++++++++++------------------ scripts/recalculate-hashes.clj | 22 +++++++++++----------- 2 files changed, 29 insertions(+), 29 deletions(-) (limited to 'scripts') diff --git a/scripts/ci/coverage_badge.clj b/scripts/ci/coverage_badge.clj index a8a0948..4cb5947 100644 --- a/scripts/ci/coverage_badge.clj +++ b/scripts/ci/coverage_badge.clj @@ -7,25 +7,25 @@ (def cloverage-output "target/coverage/index.html") (def coverage (let [rows (-> cloverage-output - slurp - h/parse - h/as-hickory - :content first ;; get - :content (nth 3) ;; get - :content second ;; get - :content last ;; get - :content) - total-row (->> rows - (map :content) - (filter sequential?) - (filter #(= "Totals:" (get-in % [0 :content 0]))) - first - (filter map?))] + slurp + h/parse + h/as-hickory + :content first ;; get + :content (nth 3) ;; get + :content second ;; get
+ :content last ;; get + :content) + total-row (->> rows + (map :content) + (filter sequential?) + (filter #(= "Totals:" (get-in % [0 :content 0]))) + first + (filter map?))] (-> total-row - (nth 2) - :content - first - (string/replace " " "")))) + (nth 2) + :content + first + (string/replace " " "")))) ;; "25" will make "%25" which decoded to "%", removing it will result in a Bad Request (def badge-url (str "https://img.shields.io/badge/coverage-" coverage "25-green")) (def badge-html diff --git a/scripts/recalculate-hashes.clj b/scripts/recalculate-hashes.clj index b42a0d1..67c0251 100644 --- a/scripts/recalculate-hashes.clj +++ b/scripts/recalculate-hashes.clj @@ -24,11 +24,11 @@ (->> (line-seq r) (map edn/read-string) f))) -(defn- java-digest [^String s algo] - (let [algorithm (MessageDigest/getInstance algo) - raw-bytes (.digest algorithm (.getBytes s "UTF-8"))] +(defn- java-digest [^String s algo] + (let [algorithm (MessageDigest/getInstance algo) + raw-bytes (.digest algorithm (.getBytes s "UTF-8"))] (apply str (map #(format "%02x" %) raw-bytes)))) -(defn digest +(defn digest ([s] (digest s :sha-256 32)) ([s algo] @@ -45,16 +45,16 @@ ;; end (let [[datafile] *command-line-args*] - (with-webmentions datafile + (with-webmentions datafile (fn [wms] (println "starting reading, total count:" (count wms)) (->> wms (map (fn [wm] - (let [webmention (:webmention wm) - source (:source webmention) - target (:target webmention) - new-id (digest (str source target))] - (println new-id) - (assoc wm :webmention (assoc webmention :id new-id))))) + (let [webmention (:webmention wm) + source (:source webmention) + target (:target webmention) + new-id (digest (str source target))] + (println new-id) + (assoc wm :webmention (assoc webmention :id new-id))))) (unload-data datafile)) (println "complete!")))) -- cgit v1.2.3