Przeglądaj źródła

chore: add db and file graph linter to CI

This has run successfully locally for weeks. Also fix install doc for
bb tasks
Gabriel Horner 2 lat temu
rodzic
commit
6f9143df4f

+ 3 - 0
.github/workflows/build.yml

@@ -120,6 +120,9 @@ jobs:
       - name: Lint invalid translation entries
         run: bb lang:validate-translations
 
+      - name: Lint to keep db and file graph code separate
+        run: bb lint:db-and-file-graphs-separate
+
   db-graph-test:
     strategy:
       matrix:

+ 1 - 1
docs/dev-practices.md

@@ -336,7 +336,7 @@ docs](https://github.com/logseq/bb-tasks#logseqbb-tasksnbbwatch) for more info.
 These tasks are specific to database graphs. For these tasks there is a one time setup:
 
 ```sh
-  $ cd deps/db && yarn install && cd -
+  $ cd deps/db && yarn install && cd ../outliner && yarn install && cd ../..
 ```
 
 * `dev:validate-db` - Validates a DB graph's datascript schema

+ 3 - 1
scripts/src/logseq/tasks/dev.clj

@@ -12,11 +12,13 @@
   - clj-kondo lint
   - carve lint for unused vars
   - lint for vars that are too large
-  - lint invalid translation entries"
+  - lint invalid translation entries
+  - lint to ensure file and db graph remain separate"
   []
   (doseq [cmd ["clojure -M:clj-kondo --parallel --lint src --cache false"
                "bb lint:carve"
                "bb lint:large-vars"
+               "bb lint:db-and-file-graphs-separate"
                "bb lang:validate-translations"
                "bb lint:ns-docstrings"]]
     (println cmd)

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

@@ -78,8 +78,10 @@
                        ;; from logseq.db.frontend.schema
                        [:block/properties-text-values :block/pre-block :recent/pages :file/handle :block/file :block/properties-order]
                        (map str)
-                       ;; e.g. block/properties :title
-                       (into ["block/properties :"]))
+                       (into [;; e.g. block/properties :title
+                              "block/properties :"
+                              ;; anything org mode
+                              "org"]))
         res (apply shell {:out :string :continue true}
                    "git grep -E" (str "(" (string/join "|" file-concepts) ")")
                    db-graph-paths)]