enhance(dev): add more workers and db ns to linters

This commit is contained in:
Gabriel Horner
2025-08-01 14:37:18 -04:00
parent cf4153b1cd
commit f7e32108f2
2 changed files with 12 additions and 8 deletions

View File

@@ -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"]))

View File

@@ -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))