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
+14-40
Original file line number
Diff line number
Diff line change
@@ -26,58 +26,32 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
26
26
27
27
## Development Workflow
28
28
29
-
### Setup<!-- omit in TOC -->
29
+
### Requirements<!-- omit in TOC -->
30
30
31
-
You can set up your local environment natively or using `docker`, check out the [`docker-compose.yml`](/docker-compose.yml).
31
+
-`docker`: for running integration tests and linting
32
+
-`easyjson`: for generating type marshalers and unmarshalers
33
+
- Retrieve SDK dependencies
32
34
33
-
Example of running all the checks with docker:
34
-
```bash
35
-
docker-compose run --rm package bash -c "go get && golangci-lint run -v && go test -v"
36
-
```
37
-
38
-
To install dependencies:
35
+
You can install these tools and dependencies by using the `make requirements` command.
39
36
40
-
```bash
41
-
go get -v -t -d ./...
42
-
```
37
+
### Test <!-- omit in TOC -->
43
38
44
-
### Tests and Linter <!-- omit in TOC -->
39
+
You can run integration test and linter check by command:
45
40
46
-
Each PR should pass the tests and the linter to be accepted.
47
-
48
-
```bash
49
-
# Tests
50
-
curl -L https://install.meilisearch.com | sh # download Meilisearch
51
-
./meilisearch --master-key=masterKey --no-analytics # run Meilisearch
52
-
go clean -cache ; go test -v ./...
53
-
# Use golangci-lint
54
-
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.42.0 golangci-lint run -v
55
-
# Use gofmt
56
-
gofmt -w ./..
41
+
```shell
42
+
make test
57
43
```
58
44
59
45
### EasyJson <!-- omit in TOC -->
60
46
61
-
[`easyjson`](https://github.com/mailru/easyjson) is a package used for optimizing marshal/unmarshal Go structs to/from JSON. It takes the `types.go` file as an input, and auto-generates `types_easyjson.go` with optimized marshalling and unmarshalling methods for this SDK.
47
+
[`easyjson`](https://github.com/mailru/easyjson) is a package used for optimizing marshal/unmarshal Go structs to/from JSON.
48
+
It takes the `types.go` file as an input, and auto-generates `types_easyjson.go` with optimized
49
+
marshalling and unmarshalling methods for this SDK.
62
50
63
51
If for any reason `types.go` is modified, this file should be regenerated by running easyjson again.
64
52
65
-
#### Install easyjson <!-- omit in TOC -->
66
-
67
-
```bash
68
-
# for Go < 1.17
69
-
go get -u github.com/mailru/easyjson/...
70
-
```
71
-
#### or
72
-
```bash
73
-
# for Go >= 1.17
74
-
go get github.com/mailru/easyjson && go install github.com/mailru/easyjson/...@latest
75
-
```
76
-
77
-
#### Regenerate `types_easyjson.go`<!-- omit in TOC -->
0 commit comments