pull/4023/head
Gabriel Horner 2022-01-27 15:26:14 -05:00
parent 1c8586e2ac
commit 821ebcb888
2 changed files with 26 additions and 1 deletions

View File

@ -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 [
;; Ignore b/c too many false positives
frontend.db

View File

@ -4,6 +4,8 @@ This page describes development practices for this codebase.
## Linting
### Clojure code
To lint:
```
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`
* 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
We have unit and end to end tests as described in https://github.com/logseq/logseq#5-run-tests.