Skip to content

Commit

Permalink
docs(dev): update linting to match bb dev:lint
Browse files Browse the repository at this point in the history
update to match `$ bb dev:lint`
```cljs
(defn lint
  "Run all lint tasks
  - clj-kondo lint
  - carve lint for unused vars
  - lint for vars that are too large
  - lint invalid translation entries"
  []
  (doseq [cmd ["clojure -M:clj-kondo --parallel --lint src --cache false"
               "bb lint:carve"
               "bb lint:large-vars"
               "bb lang:invalid-translations"
               "bb lint:ns-docstrings"]]
    (println cmd)
    (shell cmd)))
```

not sure if we should just add `$ bb dev:lint` since it doesn't seem to be documented anywhere

this update is a pre-req to adding docs for data validation with Malli from https://github.com/logseq/logseq/blob/dev/malli-schema%2526kondo-config/

```sh
bb dev:gen-malli-kondo-config
```

Note that it will also need to be added to `build.yaml`
https://github.com/logseq/logseq/blob/dev/malli-schema%26kondo-config/.github/workflows/build.yml

CC: @RCmerci
  • Loading branch information
Bad3r authored and andelf committed Jan 12, 2023
1 parent 8431187 commit 55971f0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/dev-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ this section, run `bb dev:lint`.
### Clojure code

To lint:
```
clojure -M:clj-kondo --lint src
```sh
clojure -M:clj-kondo --parallel --lint src --cache false
```

We lint our Clojure(Script) code with https://github.com/clj-kondo/clj-kondo/. If you need to configure specific linters, see [this documentation](https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.md). Where possible, a global linting configuration is used and namespace specific configuration is avoided.
Expand All @@ -27,15 +27,15 @@ There are outstanding linting items that are currently ignored to allow linting
We use https://github.com/borkdude/carve to detect unused vars in our codebase.

To run this linter:
```
```sh
bb lint:carve
```

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:

```
```sh
bb lint:carve '{:interactive true}'
```

Expand All @@ -46,7 +46,7 @@ why a var is ignored to help others understand why it's unused.

Large vars have a lot of complexity and make it hard for the team to maintain
and understand them. To run this linter:
```
```sh
bb lint:large-vars
```

Expand All @@ -55,7 +55,7 @@ To configure the linter, see the `[:tasks/config :large-vars]` path of bb.edn.
### Document namespaces

Documentation helps teams share their knowledge and enables more individuals to contribute to the codebase. Documenting our namespaces is a good first step to improving our documentation. To run this linter:
```
```sh
bb lint:ns-docstrings
```

Expand Down Expand Up @@ -83,16 +83,17 @@ We have unit and end to end tests.

To run end to end tests

``` bash
```sh
yarn electron-watch
# in another shell
yarn e2e-test # or npx playwright test
```

If e2e failed after first running:
- `rm -rdf ~/.logseq`
- `rm -rdf ~/.config/Logseq`
- `rm -rdf <repo dir>/tmp/`
- `rm -rdf <appData dir>/Electron` (Reference: https://www.electronjs.org/de/docs/latest/api/app#appgetpathname)
- Windows: `rmdir /s %APPDATA%/Electron` (Reference: https://www.electronjs.org/de/docs/latest/api/app#appgetpathname)

If e2e tests fail, they can be debugged by examining a trace dump with [the
playwright trace
Expand Down

0 comments on commit 55971f0

Please sign in to comment.