mirror of https://github.com/logseq/logseq
Add docs
parent
1c8586e2ac
commit
821ebcb888
|
@ -1,4 +1,6 @@
|
||||||
{:paths ["src/main" "src/electron" "src/test"]
|
{;; Only lint production namespaces as most dev
|
||||||
|
;; namespaces are unused
|
||||||
|
:paths ["src/main" "src/electron" "src/test"]
|
||||||
:api-namespaces [
|
:api-namespaces [
|
||||||
;; Ignore b/c too many false positives
|
;; Ignore b/c too many false positives
|
||||||
frontend.db
|
frontend.db
|
||||||
|
|
|
@ -4,6 +4,8 @@ This page describes development practices for this codebase.
|
||||||
|
|
||||||
## Linting
|
## Linting
|
||||||
|
|
||||||
|
### Clojure code
|
||||||
|
|
||||||
To lint:
|
To lint:
|
||||||
```
|
```
|
||||||
clojure -M:clj-kondo --lint src
|
clojure -M:clj-kondo --lint src
|
||||||
|
@ -16,6 +18,27 @@ There are outstanding linting items that are currently ignored to allow linting
|
||||||
* Comments starting with `TODO:lint`
|
* Comments starting with `TODO:lint`
|
||||||
* Code marked with `#_:clj-kondo/ignore` require a good understanding of the context to address as they usually involve something with a side effect or require changing multiple fns up the call stack.
|
* Code marked with `#_:clj-kondo/ignore` require a good understanding of the context to address as they usually involve something with a side effect or require changing multiple fns up the call stack.
|
||||||
|
|
||||||
|
### Unused vars
|
||||||
|
|
||||||
|
We use https://github.com/borkdude/carve to detect unused vars in our codebase.
|
||||||
|
Before running it, please install https://github.com/babashka/babashka.
|
||||||
|
|
||||||
|
To run this linter:
|
||||||
|
```
|
||||||
|
scripts/carve.clj
|
||||||
|
```
|
||||||
|
|
||||||
|
By default, the script runs in CI mode which prints unused vars if they are
|
||||||
|
found. The script can be run in an interactive mode which prompts for keeping
|
||||||
|
(ignoring) an unused var or removing it. Run this mode with:
|
||||||
|
|
||||||
|
```
|
||||||
|
scripts/carve.clj '{:interactive true}'
|
||||||
|
```
|
||||||
|
|
||||||
|
When a var is ignored, it is added to `.carve/ignore`. Please add a comment for
|
||||||
|
why a var is ignored to help others understand why it's unused.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
We have unit and end to end tests as described in https://github.com/logseq/logseq#5-run-tests.
|
We have unit and end to end tests as described in https://github.com/logseq/logseq#5-run-tests.
|
||||||
|
|
Loading…
Reference in New Issue