mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
enhance(dev): add more workers and db ns to linters
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
"electron.db"
|
||||
"frontend.handler.db-based."
|
||||
"frontend.worker.handler.page.db-based"
|
||||
"frontend.components.property" "frontend.components.class" "frontend.components.quick-add"
|
||||
"frontend.inference-worker"
|
||||
"frontend.components.property" "frontend.components.class" "frontend.components.quick-add" "frontend.components.vector-search"
|
||||
"frontend.components.db-based" "frontend.components.objects" "frontend.components.query.view"
|
||||
"mobile.core" "mobile.events" "mobile.externals" "mobile.init" "mobile.ionic" "mobile.state"
|
||||
"mobile.components"]))
|
||||
@@ -58,8 +59,10 @@
|
||||
"src/main/frontend/components/property"
|
||||
"src/main/frontend/components/objects.cljs"
|
||||
"src/main/frontend/components/quick_add.cljs"
|
||||
"src/main/frontend/components/vector_search"
|
||||
"src/main/frontend/components/db_based"
|
||||
"src/main/frontend/components/query/view.cljs"
|
||||
"src/main/frontend/inference_worker"
|
||||
"src/electron/electron/db.cljs"
|
||||
"src/main/mobile"]))
|
||||
|
||||
|
||||
@@ -43,13 +43,14 @@
|
||||
(when (pos? (:exit res)) (System/exit (:exit res)))))
|
||||
(println "No clj* files have changed to lint."))))
|
||||
|
||||
(defn- validate-frontend-not-in-worker
|
||||
(defn- validate-frontend-not-in-workers
|
||||
[]
|
||||
(let [res (shell {:out :string}
|
||||
"git grep -h" "\\[frontend.*:as" "src/main/frontend/worker")
|
||||
"git grep -h" "\\[frontend.*:as"
|
||||
"src/main/frontend/worker" "src/main/frontend/worker_common" "src/main/frontend/inference_worker")
|
||||
req-lines (->> (:out res)
|
||||
string/split-lines
|
||||
(remove #(re-find #"frontend\.worker|frontend\.common" %)))]
|
||||
(remove #(re-find #"frontend\.worker|frontend\.common|frontend\.inference-worker" %)))]
|
||||
|
||||
(if (seq req-lines)
|
||||
(do
|
||||
@@ -58,7 +59,7 @@
|
||||
(System/exit 1))
|
||||
(println "Valid worker namespaces!"))))
|
||||
|
||||
(defn- validate-worker-not-in-frontend
|
||||
(defn- validate-workers-not-in-frontend
|
||||
[]
|
||||
(let [res (shell {:out :string :continue true}
|
||||
"grep -r --exclude-dir=worker --exclude-dir=inference_worker" "\\[frontend.worker.*:" "src/main/frontend")
|
||||
@@ -75,7 +76,7 @@
|
||||
(println "Valid frontend namespaces!"))))
|
||||
|
||||
(defn worker-and-frontend-separate
|
||||
"Ensures worker is independent of frontend"
|
||||
"Ensures workers are independent of frontend"
|
||||
[]
|
||||
(validate-frontend-not-in-worker)
|
||||
(validate-worker-not-in-frontend))
|
||||
(validate-frontend-not-in-workers)
|
||||
(validate-workers-not-in-frontend))
|
||||
|
||||
Reference in New Issue
Block a user