浏览代码

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

Gabriel Horner 2 月之前
父节点
当前提交
f7e32108f2
共有 2 个文件被更改,包括 12 次插入8 次删除
  1. 4 1
      scripts/src/logseq/tasks/dev/db_and_file_graphs.clj
  2. 8 7
      scripts/src/logseq/tasks/dev/lint.clj

+ 4 - 1
scripts/src/logseq/tasks/dev/db_and_file_graphs.clj

@@ -18,7 +18,8 @@
          "electron.db"
          "electron.db"
          "frontend.handler.db-based."
          "frontend.handler.db-based."
          "frontend.worker.handler.page.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"
          "frontend.components.db-based" "frontend.components.objects" "frontend.components.query.view"
          "mobile.core" "mobile.events" "mobile.externals" "mobile.init" "mobile.ionic" "mobile.state"
          "mobile.core" "mobile.events" "mobile.externals" "mobile.init" "mobile.ionic" "mobile.state"
          "mobile.components"]))
          "mobile.components"]))
@@ -58,8 +59,10 @@
          "src/main/frontend/components/property"
          "src/main/frontend/components/property"
          "src/main/frontend/components/objects.cljs"
          "src/main/frontend/components/objects.cljs"
          "src/main/frontend/components/quick_add.cljs"
          "src/main/frontend/components/quick_add.cljs"
+         "src/main/frontend/components/vector_search"
          "src/main/frontend/components/db_based"
          "src/main/frontend/components/db_based"
          "src/main/frontend/components/query/view.cljs"
          "src/main/frontend/components/query/view.cljs"
+         "src/main/frontend/inference_worker"
          "src/electron/electron/db.cljs"
          "src/electron/electron/db.cljs"
          "src/main/mobile"]))
          "src/main/mobile"]))
 
 

+ 8 - 7
scripts/src/logseq/tasks/dev/lint.clj

@@ -43,13 +43,14 @@
           (when (pos? (:exit res)) (System/exit (:exit res)))))
           (when (pos? (:exit res)) (System/exit (:exit res)))))
       (println "No clj* files have changed to lint."))))
       (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}
   (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)
         req-lines (->> (:out res)
                        string/split-lines
                        string/split-lines
-                       (remove #(re-find #"frontend\.worker|frontend\.common" %)))]
+                       (remove #(re-find #"frontend\.worker|frontend\.common|frontend\.inference-worker" %)))]
 
 
     (if (seq req-lines)
     (if (seq req-lines)
       (do
       (do
@@ -58,7 +59,7 @@
         (System/exit 1))
         (System/exit 1))
       (println "Valid worker namespaces!"))))
       (println "Valid worker namespaces!"))))
 
 
-(defn- validate-worker-not-in-frontend
+(defn- validate-workers-not-in-frontend
   []
   []
   (let [res (shell {:out :string :continue true}
   (let [res (shell {:out :string :continue true}
                    "grep -r --exclude-dir=worker --exclude-dir=inference_worker" "\\[frontend.worker.*:" "src/main/frontend")
                    "grep -r --exclude-dir=worker --exclude-dir=inference_worker" "\\[frontend.worker.*:" "src/main/frontend")
@@ -75,7 +76,7 @@
       (println "Valid frontend namespaces!"))))
       (println "Valid frontend namespaces!"))))
 
 
 (defn worker-and-frontend-separate
 (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))