Skip to content

Commit 95cfd88

Browse files
committed
docs(CONTRIBUTING): update guide with Devbox and manual setup instructions
1 parent c985fe8 commit 95cfd88

File tree

1 file changed

+69
-12
lines changed

1 file changed

+69
-12
lines changed

CONTRIBUTING.md

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,80 @@ Contributions are welcome! Feel free to open an issue or submit a pull request.
44

55
## Development Environment Setup
66

7+
### Using Devbox (Recommended)
8+
79
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.
810

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/).
1012
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.
1513

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`
1772

18-
Additionally, you can make use of the provided `Makefile` to run various tasks:
73+
#### Common tasks
1974

2075
```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
2683
```

0 commit comments

Comments
 (0)