You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/contributing/contribute-to-documentation.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Contribute to Documentation
1
+
# Contribute to documentation
2
2
3
3
Most of the work on the Hypha User Guide takes place on the [project’s GitHub repository](https://github.com/HyphaApp/hypha/). To get started, check out the list of [open issues](https://github.com/HyphaApp/hypha/issues) and pull requests. By contributing to the Hypha User Guide, you’re expected to follow the [Code of Conduct](./code-of-conduct.md).
4
4
@@ -19,7 +19,7 @@ This project consists of several distinct documentation types with specific purp
19
19
Provides step-by-step instructions on how to set up a local instance of Hypha.
20
20
> Write technical documentation with a new developer in mind. Create a quickstart doc wherever possible. What is the bare minimum information that a user needs to get started with the feature that you are documenting? Start there.
21
21
22
-
### User Guides
22
+
### User guides
23
23
24
24
Guides are focused on accomplishing a specific task and can assume some level of prerequisite knowledge. There may be multiple approaches to accomplishing a task, and we welcome your input.
Copy file name to clipboardExpand all lines: docs/getting-started/contributing/developer-tips.md
+69-11
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Hypha developer tips
1
+
# Developer tips
2
2
3
3
## Git configuration and commands
4
4
@@ -24,11 +24,71 @@ To update the feature branch on GitHub you then need to do a forced push. Instea
24
24
git push --force-with-lease
25
25
```
26
26
27
+
## Coding style and linting in pre-commit hook
28
+
29
+
Hypha's coding style is enforced by ruff, stylelint and biome.
30
+
31
+
Install pre-commit to auto-format the code before each commit:
32
+
33
+
```shell
34
+
pre-commit install
35
+
```
36
+
37
+
If you want to check all files without committing you can run:
38
+
39
+
```shell
40
+
pre-commit run --all-files
41
+
```
42
+
43
+
The pre-commit hook also updates the requirements files for you, see next section about uv.
44
+
45
+
46
+
## Make best use of uv
47
+
48
+
For development [uv](https://docs.astral.sh/uv/) is a Hypha requirement. It is fast and easy to use.
49
+
50
+
uv is used to:
51
+
52
+
* Setup the virtual environment
53
+
* Install python dependencies.
54
+
* Add and remove python packages.
55
+
* Update python packages.
56
+
* Generate the requirements files.
57
+
58
+
See also [Stand alone development setup](/setup/deployment/development/stand-alone/)
59
+
60
+
### Add and remove packages with uv
61
+
62
+
All python requirements are listed in `pyproject.toml`.
63
+
64
+
To add a package:
65
+
66
+
```shell
67
+
uv add django-htmx
68
+
```
69
+
70
+
To remove a package:
71
+
72
+
```shell
73
+
uv remove django-select2
74
+
```
75
+
76
+
After adding or removing a packages run this to update `uv.lock`.
77
+
78
+
```shell
79
+
uv sync
80
+
```
81
+
82
+
When you attempt to commit the pre-commit hook will update the requirements files for you.
83
+
84
+
The requirements files exist so you do not need uv for deployment.
85
+
86
+
27
87
## Postgres snapshots/restore
28
88
29
89
Hypha dev requirements contain the [dslr](https://github.com/mixxorz/DSLR) tool. Use this for fast snapshots and restores of the postgres database.
30
90
31
-
Perfekt when testing migrations and other times when you need to reset the database or switch between databases.
91
+
Perfect when testing migrations and other times when you need to reset the database or switch between databases.
32
92
33
93
Take a snapshot, you can have as many as you like.
34
94
@@ -56,23 +116,21 @@ dslr list
56
116
57
117
## Commands in Makefile
58
118
59
-
This is the one stop place to find commands for runiing test, build resources and docs, linting and code style checks/fixes.
60
-
61
-
## Coding style and linting in pre-commit hook
62
-
63
-
Hypha's coding style is enforced by ruff and prettier and comes pre-configured with prettier.
119
+
This is the one stop place to find commands for running test, build resources and docs, linting and code style checks/fixes.
64
120
65
-
Install pre-commit to auto-format the code before each commit:
121
+
The one command you will be running the most is:
66
122
67
123
```shell
68
-
pre-commit install
124
+
make serve
69
125
```
70
126
127
+
This command runs `npm watch` to keep the front end updates and runs development servers for both Hypha app and the Hypha docs.
128
+
71
129
## Editor extensions
72
130
73
-
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.
131
+
If you editor does not have 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.
74
132
75
-
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.
133
+
Your editor most likely have plugins for the other languages Hypha uses as well, css/scss, yaml and html. We recommend to install them as well.
0 commit comments