Skip to content

Commit

Permalink
Tweaks to PR
Browse files Browse the repository at this point in the history
- Move auto-formatting down as it's not as important as other sections
- Reword to have focus be on auto-formatting and less so on cljfmt
  • Loading branch information
logseq-cldwalker committed Jan 4, 2023
1 parent 133028c commit 4eec463
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/dev-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

This page describes development practices for this codebase.

## Auto-formatting

[cljfmt](https://cljdoc.org/d/cljfmt/cljfmt/0.9.0/doc/readme) is a common formatter used for Clojure, analogous to Prettier for other languages. While we do not format/indent consistently with cljfmt across the whole codebase, we recommend that you do so for code that you change/add. You can do so easily with the [Calva](https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva) extension in [VSCode](https://code.visualstudio.com/): It will (mostly) indent your code correctly as you type, and you can move your cursor to the start of the line(s) you've written and press `Tab` to auto-indent all Clojure forms nested under the one starting on the current line.

## Linting

Most of our linters require babashka. Before running them, please install
Expand Down Expand Up @@ -156,8 +152,8 @@ To write a test that uses a datascript db:
#### Performance tests
To write a performance test:

* Use `frontend.util/with-time-number` to get the time in ms.
* Use `frontend.util/with-time-number` to get the time in ms.

* Example:
```clojure
(are [x timeout] (>= timeout (:time (util/with-time-number (block/normalize-block x true))))
Expand Down Expand Up @@ -207,6 +203,10 @@ By following these conventions, these should also be usable by babashka. This is
helpful as it allows for third party tools to be written with logseq's data
model.

## Auto-formatting

Currently the codebase is not formatted/indented consistently. We loosely follow https://github.com/bbatsov/clojure-style-guide. [cljfmt](https://cljdoc.org/d/cljfmt/cljfmt/0.9.0/doc/readme) is a common formatter used for Clojure, analogous to Prettier for other languages. You can do so easily with the [Calva](https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva) extension in [VSCode](https://code.visualstudio.com/): It will (mostly) indent your code correctly as you type, and you can move your cursor to the start of the line(s) you've written and press `Tab` to auto-indent all Clojure forms nested under the one starting on the current line.

## Development Tools

There are some babashka tasks under `nbb:` which are useful for inspecting
Expand Down

0 comments on commit 4eec463

Please sign in to comment.