From 3ccf80fcba998ed1ac8aedf9cab5badddb425ede Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 2 Nov 2023 09:32:51 -0400 Subject: [PATCH] add docs for new linter also fix outliner lint --- deps/outliner/.carve/ignore | 2 ++ docs/dev-practices.md | 12 ++++++++++++ scripts/src/logseq/tasks/dev/db_and_file_graphs.clj | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 deps/outliner/.carve/ignore diff --git a/deps/outliner/.carve/ignore b/deps/outliner/.carve/ignore new file mode 100644 index 0000000000..1ca2099e39 --- /dev/null +++ b/deps/outliner/.carve/ignore @@ -0,0 +1,2 @@ +;; API fn +logseq.outliner.cli.persist-graph/add-listener diff --git a/docs/dev-practices.md b/docs/dev-practices.md index 454ca89ebb..68b655fca3 100644 --- a/docs/dev-practices.md +++ b/docs/dev-practices.md @@ -109,6 +109,18 @@ $ typos -w To configure it e.g. for dealing with false positives, see `typos.toml`. +### Separate DB and File Graph Code + +There is a growing number of code and features that are only for file or DB graphs. Run this linter to +ensure that code you add or modify keeps with existing conventions: + +``` +$ bb lint:db-and-file-graphs-separate +✅ All checks passed! +``` + +The main convention is that file and db specific files go under directories named `file_based` and `db_based` respectively. To see the full list of file and db specific namespaces and files see the top of [the script](/scripts/src/logseq/tasks/dev/db_and_file_graphs.clj). + ## Testing We have unit, performance and end to end tests. 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 0cec7d51cc..a3a48b6663 100644 --- a/scripts/src/logseq/tasks/dev/db_and_file_graphs.clj +++ b/scripts/src/logseq/tasks/dev/db_and_file_graphs.clj @@ -10,7 +10,7 @@ ["." "?"])) (def db-graph-ns - "Namespaces or parent namespaces _only_ for DB graphs" + "Namespaces or parent namespaces _only_ for DB graphs. Use a '.' at end of a namespace for parent namespaces" (mapv escape-shell-regex ["logseq.db.sqlite." "logseq.db.frontend.property" "logseq.db.frontend.malli-schema" "electron.db"