2022-04-25 15:38:39 +02:00
## Contributing to Notify
We want to make contributing to this project as easy and transparent as possible.
2021-01-25 06:05:59 +02:00
2022-09-14 16:24:33 +02:00
## Tests
Ideally, unit tests should accompany every newly introduced exported function. We're always striving to increase the project's test coverage.
If you need to mock an interface in your tests, follow the next steps:
1. Comment the interface you'd like to mock following the example below
```go
2022-09-16 09:08:30 +02:00
//go:generate mockery --name=nameOfClient --output=. --case=underscore --inpackage
type nameOfClient interface {
...
2022-09-14 16:24:33 +02:00
}
```
2022-09-16 09:08:30 +02:00
> Remember to set the `--name` argument accordingly. For real-life implementation examples, check out existing services, for example [fcm](https://github.com/nikoksr/notify/blob/bda5705e4ee1cbf6b02bbb12679ed597334dee51/service/fcm/fcm.go#L27).
2022-09-14 16:24:33 +02:00
2. Run `make mock`
> The first time you'll also need to run `make setup` to download the packages required to generate your mocks
3. Use the mocked interface in your tests
```go
2022-09-16 09:08:30 +02:00
mockClient := newMockNameOfClient(t)
2022-09-14 16:24:33 +02:00
```
2021-01-31 16:02:45 +02:00
## Commits
2022-04-25 15:38:39 +02:00
Commit messages should be well formatted, and to make that "standardized", we are using Conventional Commits.
2021-01-31 16:02:45 +02:00
2022-04-25 15:38:39 +02:00
You can follow the documentation on [their website ](https://www.conventionalcommits.org ).
2021-01-31 16:02:45 +02:00
2021-01-25 06:05:59 +02:00
## Pull Requests
2022-04-25 15:38:39 +02:00
2021-01-25 06:05:59 +02:00
We actively welcome your pull requests.
1. Fork the repo and create your branch from `main` .
2. If you've added code that should be tested, add tests.
2022-04-25 15:38:39 +02:00
3. If you've changed or added exported functions or types, document them.
4. Ensure the test suite passes (`make ci`).
2021-01-25 06:05:59 +02:00
## Issues
2022-04-25 15:38:39 +02:00
We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be
able to reproduce the issue.
2021-01-25 06:05:59 +02:00
## License
2022-04-25 15:38:39 +02:00
By contributing to notify, you agree that your contributions will be licensed under the LICENSE file in the root
directory of this source tree.