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: CONTRIBUTING.md
+69-12Lines changed: 69 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,80 @@ Contributions are welcome! Feel free to open an issue or submit a pull request.
4
4
5
5
## Development Environment Setup
6
6
7
+
### Using Devbox (Recommended)
8
+
7
9
To set up a development environment for this repository, you can use [devbox](https://www.jetify.com/devbox) along with the provided `devbox.json` configuration file.
8
10
9
-
1. Install devbox by following the instructions in the [devbox documentation](https://www.jetify.com/devbox/docs/installing_devbox/).
11
+
1. Install devbox by following [these instructions](https://www.jetify.com/devbox/docs/installing_devbox/).
10
12
2. Clone this repository to your local machine.
11
-
3. Navigate to the root directory of the cloned repository.
12
-
4. Run `devbox install` to install all packages mentioned in the `devbox.json` file.
13
-
5. Run `devbox shell` to start a new shell with access to the environment.
14
-
6. Once the devbox environment is set up, you can start developing, testing, and contributing to the repository.
15
13
16
-
### Using Makefile
14
+
```bash
15
+
git clone https://github.com/indaco/goaster.git
16
+
cd goaster
17
+
```
18
+
19
+
3. Run `devbox install` to install all dependencies specified in `devbox.json`.
20
+
4. Enter the environment with `devbox shell --pure`.
21
+
5. Start developing, testing, and contributing!
22
+
23
+
### Manual Setup
24
+
25
+
If you prefer not to use Devbox, ensure you have the following tools installed:
26
+
27
+
-[golangci-lint](https://golangci-lint.run/): For linting Go code.
28
+
-[go-task](https://taskfile.dev/) or `make`: For running project tasks.
29
+
-[modernize](https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize): Run the modernizer analyzer to simplify code by using modern constructs.
30
+
31
+
## Setting Up Git Hooks
32
+
33
+
Git hooks are used to enforce code quality and streamline the workflow. Follow these steps to set them up:
34
+
35
+
### Using Devbox
36
+
37
+
If using `devbox`, Git hooks are automatically installed when you run `devbox shell`. No further action is required.
38
+
39
+
### Manual Setup
40
+
41
+
For users not using `devbox`, follow the steps below to manually install the Git hooks:
42
+
43
+
1. Clone the repository:
44
+
45
+
```bash
46
+
git clone https://github.com/indaco/goaster.git
47
+
cd goaster
48
+
```
49
+
50
+
2. Install the Git Hooks
51
+
52
+
**Unix-based systems (Linux, macOS):**
53
+
54
+
```bash
55
+
sh .scripts/setup-hooks.sh
56
+
```
57
+
58
+
**Windows systems:**
59
+
60
+
```cmd
61
+
.scripts\setup-hooks.bat
62
+
```
63
+
64
+
## Running Tasks
65
+
66
+
This project provides both a `Makefile` and a `Taskfile` for running various tasks. You can use either `make` or `task` to execute the tasks, depending on your preference.
67
+
68
+
### View all available tasks
69
+
70
+
-_Makefile_: `make help`
71
+
-_Taskfile_: `task --list-all`
17
72
18
-
Additionally, you can make use of the provided `Makefile` to run various tasks:
73
+
#### Common tasks
19
74
20
75
```bash
21
-
make build # The main build target
22
-
make examples # Process templ files in the _examples folder
23
-
make templ # Process TEMPL files
24
-
make test# Run go tests
25
-
make help# Print this help message
76
+
build: # Build for production with minified asset files
77
+
dev: # Run the dev server with live reload
78
+
pre-build: # Run pre-build tasks
79
+
templ: # Run templ fmt and templ generate commands
80
+
test: # Run all tests and generate coverage report
81
+
test/coverage: # Run go tests and use go tool cover
82
+
test/force: # Clean go tests cache and run all tests
0 commit comments