diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b3bc0924f..51a5454b9c 100644 --- a/.github/workflows/build.yml +++ b/.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: diff --git a/docs/dev-practices.md b/docs/dev-practices.md index 54af4c02f6..9523921d7c 100644 --- a/docs/dev-practices.md +++ b/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 diff --git a/scripts/src/logseq/tasks/dev.clj b/scripts/src/logseq/tasks/dev.clj index e3b9915d5b..39b6bac8be 100644 --- a/scripts/src/logseq/tasks/dev.clj +++ b/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) diff --git a/scripts/src/logseq/tasks/dev/db_and_file_graphs.clj b/scripts/src/logseq/tasks/dev/db_and_file_graphs.clj index a384b1ba11..8c3f1f30f2 100644 --- a/scripts/src/logseq/tasks/dev/db_and_file_graphs.clj +++ b/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)]