Skip to content

contributing

Mathieu Tortuyaux edited this page Nov 8, 2019 · 1 revision

⚠️ This is a draft⚠️ of "how to contribute to YulMails".

First: thank you for the time you want to dedicate to this project.

Variable name

Following some Go standard:

  • variables are wrote using camelCase.
  • the less important variable is, the shortest name will be.

CI

We are using GitLab CI to build our docker images and run our tests. You can check the details of the pipeline and see what's going wrong if you have an error.

Test

There is not yet many tests inside the project. Before submitting a PR, you can check that everything is still working by running:

$ go test ./...

Commit

git is a really powerful tool: use it !

Some hints to keep the project clear:

  • never use "merge" function -> use rebase instead !
  • clear and atomic commit
  • short commit message with long explanation if needed

example:

entrypoint: start the entrypoint from command line

you can start the entrypoint by using `yultctl`:
$ yulctl entrypoint
you can specify the JSON configuration with
$ yulctl entrypoint --smtp-config /path/to/json/config.json
see `conf/` to get a working example

Lint

Go is a strongly formatted language. It means, there is no much many ways to write code. Before submitting a PR, please lint your code with this tool.

goimports will manage your import lines and run a go fmt on the files.

example:

package main

import           "fmt"


func main() {
        a , b   := 5, 6
        fmt.Printf(  "%d",a+b)
}

run $ goimports -w main.go

package main

import "fmt"

func main() {
        a, b := 5, 6
        fmt.Printf("%d", a+b)
}

Clone this wiki locally