-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CONTRIBUTING.md and development.md (#56)
- Add the `CONTRIBUTING.md` document - Add the `docs/development.md` document - Add **Contributing** section to the main `README.md` - Update `docs/README.md`'s table of contents - Delete duplicate issue templates
- Loading branch information
1 parent
4f46df1
commit d6bdfac
Showing
6 changed files
with
139 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<h1> | ||
<img alt="logo" src="./docs/assets/logo-small.png" width="28px" /> | ||
Codeowners Validator - contributing | ||
</h1> | ||
|
||
🎉🚀🤘 Thanks for your interest in the Codeowners Validator project! 🤘🚀🎉 | ||
|
||
This document contains contribution guidelines for this repository. Read it before you start contributing. | ||
|
||
## Contributing | ||
|
||
Before proposing or adding changes, check the [existing issues](https://github.com/mszostok/codeowners-validator/issues) and make sure the discussion/work has not already been started to avoid duplication. | ||
|
||
If you'd like to see a new feature implemented, use this [feature request template](https://github.com/mszostok/codeowners-validator/issues/new?assignees=&labels=&template=feature_request.md) to create an issue. | ||
|
||
Similarly, if you spot a bug, use this [bug report template](https://github.com/mszostok/codeowners-validator/issues/new?assignees=mszostok&labels=bug&template=bug_report.md) to let us know! | ||
|
||
### Ready for action? Start developing! | ||
|
||
To start contributing, follow these steps: | ||
|
||
1. Fork the `codeowners-validator` repository. | ||
|
||
2. Clone the repository locally. | ||
|
||
> **TIP:** This project uses Go modules, so you can check it out locally wherever you want. It doesn't need to be checked out in `$GOPATH`. | ||
3. Set the `codeowners-validator` repository as upstream: | ||
|
||
```bash | ||
git remote add upstream git@github.com:mszostok/codeowners-validator.git | ||
``` | ||
|
||
4. Fetch all the remote branches for this repository: | ||
|
||
```bash | ||
git fetch --all | ||
``` | ||
|
||
5. Set the master branch to point to upstream: | ||
|
||
```bash | ||
git branch -u upstream/master master | ||
``` | ||
|
||
You're all set! 🚀 Read the [development](./docs/development.md) document for further instructions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
[← back to docs](./README.md) | ||
|
||
# Development | ||
|
||
This document contains development instructions. Read it to learn how to develop this project. | ||
|
||
# Table of Contents | ||
|
||
<!-- toc --> | ||
|
||
- [Prerequisites](#prerequisites) | ||
- [Dependency management](#dependency-management) | ||
- [Testing](#testing) | ||
* [Unit tests](#unit-tests) | ||
* [Lint tests](#lint-tests) | ||
* [Integration tests](#integration-tests) | ||
- [Build a binary](#build-a-binary) | ||
|
||
<!-- tocstop --> | ||
|
||
## Prerequisites | ||
|
||
* [Go](https://golang.org/dl/) 1.15 or higher | ||
* [Docker](https://www.docker.com/) | ||
* Make | ||
|
||
Helper scripts may introduce additional dependencies. However, all helper scripts support the `INSTALL_DEPS` environment variable flag. | ||
By default, this flag is set to `false`. This way, the scripts will try to use the tools installed on your local machine. This helps speed up the development process. | ||
If you do not want to install any additional tools, or you want to ensure reproducible script | ||
results, export `INSTALL_DEPS=true`. This way, the proper tool version will be automatically installed and used. | ||
|
||
## Dependency management | ||
|
||
This project uses `go modules` for dependency management. To install all required dependencies, use the following command: | ||
|
||
```bash | ||
go mod download | ||
``` | ||
|
||
## Testing | ||
|
||
### Unit tests | ||
|
||
To run all unit tests, execute: | ||
|
||
```bash | ||
make test-unit | ||
``` | ||
|
||
To generate the unit test coverage HTML report, execute: | ||
|
||
```bash | ||
make test-unit-cover-html | ||
``` | ||
|
||
> **NOTE:** The generated report opens automatically in your default browser. | ||
### Lint tests | ||
|
||
To check your code for errors, such as typos, wrong formatting, security issues, etc., execute: | ||
|
||
```bash | ||
make test-lint | ||
``` | ||
|
||
To automatically fix detected lint issues, execute: | ||
|
||
```bash | ||
make fix-lint-issues | ||
``` | ||
|
||
### Integration tests | ||
|
||
This project supports the integration tests that are defined in the [tests](../tests) package. The tests are executed against [`gh-codeowners/codeowners-samples`](https://github.com/gh-codeowners/codeowners-samples). | ||
|
||
> **CAUTION:** Currently, running the integration tests both on external PRs and locally by external contributors is not supported, as the teams used for testing are visible only to the organization members. | ||
> At the moment, the `codeowners-validator` repository owner is responsible for running these tests. | ||
## Build a binary | ||
|
||
To generate a binary for this project, execute: | ||
```bash | ||
make build | ||
``` | ||
|
||
This command generates a binary named `codeowners-validator` in the root directory. | ||
|
||
[↑ Back to top](#table-of-contents) |