|
| 1 | +# Contributing |
| 2 | + |
| 3 | +All kinds of contributions to Dotbot are greatly appreciated. For someone |
| 4 | +unfamiliar with the code base, the most efficient way to contribute is usually |
| 5 | +to submit a [feature request](#feature-requests) or [bug report](#bug-reports). |
| 6 | +If you want to dive into the source code, you can submit a [patch](#patches) as |
| 7 | +well, either working on your own ideas or [existing issues][issues]. |
| 8 | + |
| 9 | +## Feature Requests |
| 10 | + |
| 11 | +Do you have an idea for an awesome new feature for Dotbot? Please [submit a |
| 12 | +feature request][issue]. It's great to hear about new ideas. |
| 13 | + |
| 14 | +If you are inclined to do so, you're welcome to [fork][fork] Dotbot, work on |
| 15 | +implementing the feature yourself, and submit a patch. In this case, it's |
| 16 | +*highly recommended* that you first [open an issue][issue] describing your |
| 17 | +enhancement to get early feedback on the new feature that you are implementing. |
| 18 | +This will help avoid wasted efforts and ensure that your work is incorporated |
| 19 | +into the code base. |
| 20 | + |
| 21 | +## Bug Reports |
| 22 | + |
| 23 | +Did something go wrong with Dotbot? Sorry about that! Bug reports are greatly |
| 24 | +appreciated! |
| 25 | + |
| 26 | +When you [submit a bug report][issue], please include relevant information such |
| 27 | +as Dotbot version, operating system, configuration file, error messages, and |
| 28 | +steps to reproduce the bug. The more details you can include, the easier it is |
| 29 | +to find and fix the bug. |
| 30 | + |
| 31 | +## Patches |
| 32 | + |
| 33 | +Want to hack on Dotbot? Awesome! |
| 34 | + |
| 35 | +If there are [open issues][issues], you're more than welcome to work on those - |
| 36 | +this is probably the best way to contribute to Dotbot. If you have your own |
| 37 | +ideas, that's great too! In that case, before working on substantial changes to |
| 38 | +the code base, it is *highly recommended* that you first [open an issue][issue] |
| 39 | +describing what you intend to work on. |
| 40 | + |
| 41 | +**Patches are generally submitted as pull requests.** Patches are also |
| 42 | +[accepted over email][email]. |
| 43 | + |
| 44 | +Any changes to the code base should follow the style and coding conventions |
| 45 | +used in the rest of the project. The version history should be clean, and |
| 46 | +commit messages should be descriptive and [properly |
| 47 | +formatted][commit-messages]. |
| 48 | + |
| 49 | +### Testing |
| 50 | + |
| 51 | +When preparing a patch, it's recommended that you add unit tests |
| 52 | +that demonstrate the bug is fixed (or that the feature works). You |
| 53 | +can run tests on your local machine using [Hatch][hatch]: |
| 54 | + |
| 55 | +```bash |
| 56 | +hatch test |
| 57 | +``` |
| 58 | + |
| 59 | +If you prefer to run the tests in an isolated container using Docker, you can |
| 60 | +do so with the following: |
| 61 | + |
| 62 | +```bash |
| 63 | +docker run -it --rm -v "${PWD}:/dotbot" -w /dotbot python:3.13-bookworm /bin/bash |
| 64 | +``` |
| 65 | + |
| 66 | +After spawning the container, install Hatch with `pip install hatch`, and then |
| 67 | +run the tests. |
| 68 | + |
| 69 | +### Type checking |
| 70 | + |
| 71 | +You can run type checking with: |
| 72 | + |
| 73 | +```bash |
| 74 | +hatch run types:check |
| 75 | +``` |
| 76 | + |
| 77 | +### Formatting and linting |
| 78 | + |
| 79 | +You can run the [Ruff][ruff] formatter and linter with: |
| 80 | + |
| 81 | +```bash |
| 82 | +hatch fmt |
| 83 | +``` |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +If you have any questions about anything, feel free to [ask][email]! |
| 88 | + |
| 89 | +[issue]: https://github.com/anishathalye/dotbot/issues/new |
| 90 | +[issues]: https://github.com/anishathalye/dotbot/issues |
| 91 | +[fork]: https://github.com/anishathalye/dotbot/fork |
| 92 | + |
| 93 | +[commit-messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html |
| 94 | +[hatch]: https://hatch.pypa.io/ |
| 95 | +[ruff]: https://github.com/astral-sh/ruff |
0 commit comments