Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Hypha developer tips
## Git config
To avoid spurious merge commits use a rebase workflow when appropriate.
Set this to always use rebase when pulling in updates in a branch.
```shell
git config --global branch.autosetuprebase always
```
When updating a feature branch with new commits from the main branch use `rebase` and not `merge`
```shell
git switch feature-branch-name
git fetch origin
git rebase origin/main
```
## Postgres snapshots/restore
Hypha dev requirements contain the [dslr](https://github.com/mixxorz/DSLR) tool. Use this for fast snapshots and restores of the postgres database.
Perfekt when testing migrations and other times when you need to reset the database or switch between databases.
Take a snapshot, you can have as many as you like.
```shell
dslr snapshot name-of-the-snapshot
```
Restore the snapshot.
```shell
dslr restore name-of-the-snapshot
```
Delete a snapshot you no longer need.
```shell
dslr delete name-of-the-snapshot
```
List all your snapshots:
```shell
dslr list
```
## Commands in Makefile
This is the one stop place to find commands for runiing test, build resources and docs, linting and code style checks/fixes.
## Coding style and linting in pre-commit hook
Hypha's coding style is enforced by ruff and prettier and comes pre-configured with prettier.
Install pre-commit to auto-format the code before each commit:
```shell
pre-commit install
```
## Editor extensions
If you editor does not a Language Server Protocol (LSP) preinstalled make sure to add the plugin for it. Then add "LSP-ruff" for a fast Python linter and code transformation tool.
Your editor most likely have plugins for the other languages Hypha uses as well, css/scss, yaml and html. We recoment to install them as well.