diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..d6bf99b2e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# How to Contribute + +We want to make contributing to this project as easy as possible. + +## Reporting Issues and Enhancements + +If you have an issue, please report it on the [issue tracker](https://github.com/xanzy/go-gitlab/issues) + +If there is a documented feature within Gitlab + +## Contributing Code + +Pull requests are always welcome. If adding code that needs to be tested, try to add tests if there aren't any. + +We use [`gofumpt`](https://github.com/mvdan/gofumpt) to format this project. + +### Setting up your local development environment to Contribute to `go-gitlab` + +1. [Fork](https://github.com/xanzy/go-gitlab/fork), then clone the repository. + ```sh + git clone https://github.com//go-gitlab.git + # or via ssh + git clone git@github.com:/go-gitlab.git + ``` +1. Install dependencies: + ```sh + make setup + ``` +1. Make your changes on your feature branch +1. Run the tests and `gofumpt` + ```sh + make test && make fmt + ``` +1. Open up your pull request + diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..111faf26d --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +setup: + go mod tidy + @go install mvdan.cc/gofumpt@latest + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +.PHONY: setup + +test: + go test ./... -race #-v?? +.PHONY: test + +fmt: + @gofumpt -l -w . +.PHONY: fmt + +lint: + @golangci-lint run --config .golangci.yml +.PHONY: lint diff --git a/README.md b/README.md index a7fd7cfbb..06ddb255d 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,10 @@ For complete usage of go-gitlab, see the full [package docs](https://godoc.org/g Sander van Harmelen () +## Contributing + +Contributions are always welcome. For more information, check out the [contributing guide](https://github.com/xanzy/go-gitlab/blob/master/CONTRIBUTING.md) + ## License Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at