Skip to content

Commit c51af72

Browse files
committedAug 21, 2024·
docs: update contributing rules
1 parent 8e7be4a commit c51af72

File tree

2 files changed

+17
-43
lines changed

2 files changed

+17
-43
lines changed
 

‎CONTRIBUTING.md

+14-40
Original file line numberDiff line numberDiff line change
@@ -26,58 +26,32 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
2626

2727
## Development Workflow
2828

29-
### Setup <!-- omit in TOC -->
29+
### Requirements <!-- omit in TOC -->
3030

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
3234

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.
3936

40-
```bash
41-
go get -v -t -d ./...
42-
```
37+
### Test <!-- omit in TOC -->
4338

44-
### Tests and Linter <!-- omit in TOC -->
39+
You can run integration test and linter check by command:
4540

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
5743
```
5844

5945
### EasyJson <!-- omit in TOC -->
6046

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.
6250

6351
If for any reason `types.go` is modified, this file should be regenerated by running easyjson again.
6452

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 -->
78-
79-
```bash
80-
easyjson -all types.go
53+
```shell
54+
make easyjson
8155
```
8256

8357
## Git Guidelines

‎makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
.PHONY: test easyjson install-tool
1+
.PHONY: test easyjson requirements
22

33
easyjson:
44
easyjson -all types.go
55

66
test:
77
docker compose run --rm package bash -c "go get && golangci-lint run -v && go test -v"
88

9-
install-tool:
9+
requirements:
1010
go get github.com/mailru/easyjson && go install github.com/mailru/easyjson/...@latest
1111
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
12-
12+
go get -v -t ./...

0 commit comments

Comments
 (0)
Please sign in to comment.