| 1 |
# Contributing |
| 2 |
|
| 3 |
Contributions are welcome, and they are greatly appreciated! Every little helps, and credit will always be given. |
| 4 |
|
| 5 |
You can contribute in many ways: |
| 6 |
|
| 7 |
## Types of Contributions |
| 8 |
|
| 9 |
### Report Bugs |
| 10 |
|
| 11 |
Report bugs to [our issue page][gh-issues]. If you are reporting a bug, please include: |
| 12 |
|
| 13 |
- Your operating system name and version. |
| 14 |
- Any details about your local setup that might be helpful in troubleshooting. |
| 15 |
- Detailed steps to reproduce the bug. |
| 16 |
|
| 17 |
### Fix Bugs |
| 18 |
|
| 19 |
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. |
| 20 |
|
| 21 |
### Implement Features |
| 22 |
|
| 23 |
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. |
| 24 |
|
| 25 |
### Write Documentation |
| 26 |
|
| 27 |
habluetooth could always use more documentation, whether as part of the official habluetooth docs, in docstrings, or even on the web in blog posts, articles, and such. |
| 28 |
|
| 29 |
### Submit Feedback |
| 30 |
|
| 31 |
The best way to send feedback [our issue page][gh-issues] on GitHub. If you are proposing a feature: |
| 32 |
|
| 33 |
- Explain in detail how it would work. |
| 34 |
- Keep the scope as narrow as possible, to make it easier to implement. |
| 35 |
- Remember that this is a volunteer-driven project, and that contributions are welcome 😊 |
| 36 |
|
| 37 |
## Get Started! |
| 38 |
|
| 39 |
Ready to contribute? Here's how to set yourself up for local development. |
| 40 |
|
| 41 |
1. Fork the repo on GitHub. |
| 42 |
|
| 43 |
2. Clone your fork locally: |
| 44 |
|
| 45 |
```shell |
| 46 |
$ git clone [email protected]:your_name_here/habluetooth.git |
| 47 |
``` |
| 48 |
|
| 49 |
3. Install the project dependencies with [Poetry](https://python-poetry.org): |
| 50 |
|
| 51 |
```shell |
| 52 |
$ poetry install |
| 53 |
``` |
| 54 |
|
| 55 |
4. Create a branch for local development: |
| 56 |
|
| 57 |
```shell |
| 58 |
$ git checkout -b name-of-your-bugfix-or-feature |
| 59 |
``` |
| 60 |
|
| 61 |
Now you can make your changes locally. |
| 62 |
|
| 63 |
5. When you're done making changes, check that your changes pass our tests: |
| 64 |
|
| 65 |
```shell |
| 66 |
$ poetry run pytest |
| 67 |
``` |
| 68 |
|
| 69 |
6. Linting is done through [pre-commit](https://pre-commit.com). Provided you have the tool installed globally, you can run them all as one-off: |
| 70 |
|
| 71 |
```shell |
| 72 |
$ pre-commit run -a |
| 73 |
``` |
| 74 |
|
| 75 |
Or better, install the hooks once and have them run automatically each time you commit: |
| 76 |
|
| 77 |
```shell |
| 78 |
$ pre-commit install |
| 79 |
``` |
| 80 |
|
| 81 |
7. Commit your changes and push your branch to GitHub: |
| 82 |
|
| 83 |
```shell |
| 84 |
$ git add . |
| 85 |
$ git commit -m "feat(something): your detailed description of your changes" |
| 86 |
$ git push origin name-of-your-bugfix-or-feature |
| 87 |
``` |
| 88 |
|
| 89 |
Note: the commit message should follow [the conventional commits](https://www.conventionalcommits.org). We run [`commitlint` on CI](https://github.com/marketplace/actions/commit-linter) to validate it, and if you've installed pre-commit hooks at the previous step, the message will be checked at commit time. |
| 90 |
|
| 91 |
8. Submit a pull request through the GitHub website or using the GitHub CLI (if you have it installed): |
| 92 |
|
| 93 |
```shell |
| 94 |
$ gh pr create --fill |
| 95 |
``` |
| 96 |
|
| 97 |
## Pull Request Guidelines |
| 98 |
|
| 99 |
We like to have the pull request open as soon as possible, that's a great place to discuss any piece of work, even unfinished. You can use draft pull request if it's still a work in progress. Here are a few guidelines to follow: |
| 100 |
|
| 101 |
1. Include tests for feature or bug fixes. |
| 102 |
2. Update the documentation for significant features. |
| 103 |
3. Ensure tests are passing on CI. |
| 104 |
|
| 105 |
## Tips |
| 106 |
|
| 107 |
To run a subset of tests: |
| 108 |
|
| 109 |
```shell |
| 110 |
$ pytest tests |
| 111 |
``` |
| 112 |
|
| 113 |
## Making a new release |
| 114 |
|
| 115 |
The deployment should be automated and can be triggered from the Semantic Release workflow in GitHub. The next version will be based on [the commit logs](https://python-semantic-release.readthedocs.io/en/latest/commit-log-parsing.html#commit-log-parsing). This is done by [python-semantic-release](https://python-semantic-release.readthedocs.io/en/latest/index.html) via a GitHub action. |
| 116 |
|
| 117 |
[gh-issues]: https://github.com/bluetooth-devices/habluetooth/issues |