mirror of
https://github.com/logseq/logseq.git
synced 2026-05-24 12:44:22 +00:00
Find namespaces for nbb-compatible CI step
This commit is contained in:
24
scripts/src/logseq/tasks/nbb.clj
Normal file
24
scripts/src/logseq/tasks/nbb.clj
Normal file
@@ -0,0 +1,24 @@
|
||||
(ns logseq.tasks.nbb
|
||||
(:require [pod.borkdude.clj-kondo :as clj-kondo]))
|
||||
|
||||
(defn- fetch-meta-namespaces
|
||||
"Return namespaces with metadata"
|
||||
[paths]
|
||||
(let [paths (or (seq paths) ["src"])
|
||||
{{:keys [namespace-definitions]} :analysis}
|
||||
(clj-kondo/run!
|
||||
{:lint paths
|
||||
:config {:output {:analysis {:namespace-definitions {:meta true}}}}})
|
||||
matches (keep (fn [m]
|
||||
(when (:meta m)
|
||||
{:ns (:name m)
|
||||
:meta (:meta m)}))
|
||||
namespace-definitions)]
|
||||
matches))
|
||||
|
||||
(defn load-compatible-namespaces
|
||||
[]
|
||||
(let [namespaces (filter #(get-in % [:meta :nbb-compatible])
|
||||
(fetch-meta-namespaces ["src/main"]))]
|
||||
(assert (seq namespaces)
|
||||
"There must be some nbb-compatible namespaces")))
|
||||
Reference in New Issue
Block a user