|
1 | | -## Code Checks Before Committing |
| 1 | +# Contribution Guidelines |
2 | 2 |
|
3 | | -We use Husky and lint-staged to check your staged files. |
| 3 | +This project is open to contributors of all levels. While it is primarily geared toward members of the Code Café Discord server, |
| 4 | +anyone with an interest in contributing to open source can pick up create a bug request, feature request, or open a PR that addresses an outstanding issue. |
4 | 5 |
|
5 | | -When you commit, Husky triggers lint-staged, which runs tools like ESLint and Prettier on changed files. |
| 6 | +We ask that if you wish to contribute, you follow the best practices listed below. |
6 | 7 |
|
7 | | -If any issues are found, the commit is blocked until they’re fixed. Check your terminal output for linting or formatting errors. |
| 8 | +## For All Contributors |
| 9 | + |
| 10 | +General guidance for contributors. For maintainer-specific info, see the [For Maintainters](#for-maintainers) section. |
| 11 | + |
| 12 | +### Dos and Don'ts |
| 13 | + |
| 14 | +Do :heavy_check_mark: |
| 15 | + |
| 16 | +- Read through existing issues before opening a new bug or feature request to avoid creating duplicate issues. |
| 17 | +- Leave a comment on an open issue if you would like to work on it. If the issue is available to work on, a maintainer will assign the issue to you as soon as possible. |
| 18 | +- Keep PRs scoped to a single issue |
| 19 | + - Always prefer multiple small PRs over one larger PR that addresses multiple things. This helps better prevent "scope creep", and makes it easier for maintainers and contributors alike. It also allows more contributors to work on issues in parallel. |
| 20 | +- Ask for help if you have a question. |
| 21 | + - Feel free to leave comments on the issue if you have any questions around implementation or if you need help of any kind. |
| 22 | +- Fork the repo and create a new branch on your fork in order to start work on your assigned issue. |
| 23 | + - If you become a regular contributor, you may request to be added as a collaborator on the project so that you can work from a direct clone rather than a fork. |
| 24 | +- Name your feature branch something descriptive of your task. Including the issue number is common practice. |
| 25 | + - For example, if you are working on issue number 42 and performing a refactor on the navbar component, a good branch name would be `42-refactor-navbar-component`. |
| 26 | +- Ensure that your code works, tests pass and your code is properly linted and formatted prior to opening a PR. |
| 27 | + - We use a pre-commit hook on this project to help facilitate this. See the [Code Quality](#code-quality) section below for more information. |
| 28 | + |
| 29 | +Don't :x: |
| 30 | + |
| 31 | +- Do not start work on an issue if it has already been assigned to another contributor |
| 32 | + - If an issue has been assigned and in progress for a long time, you may comment on the issue and ask the assignee if they are still working on it. |
| 33 | + If they are not, you may ask a maintainer to assign the issue to you. |
| 34 | +- Do not work on more than one issue ticket at a time. |
| 35 | + - Doing takes away opportunities for other contributors, and can lead to bottlenecks in the project's ability to move forward. |
| 36 | +- Do not get upset if it takes time for maintainers to review your PR. Maintainers are all volunteers doing this in our free time and sometimes they are busy. |
| 37 | + |
| 38 | +## For Maintainers |
| 39 | + |
| 40 | +TODO |
| 41 | + |
| 42 | +## Additional Information |
| 43 | + |
| 44 | +### Code Quality |
| 45 | + |
| 46 | +We use a git pre-commit hook to ensure all staged files are properly linted and formatted prior to making a git commit. |
| 47 | + |
| 48 | +When you run `git commit`, the pre-commit hook runs tools like ESLint and Prettier on changed files, and tries to automatically fix any linting or formatting errors it finds. |
| 49 | + |
| 50 | +If any issues are found that cannot be auto-fixed by the tool, the commit is blocked until they’re fixed. Check your terminal output for linting or formatting errors that need to be manually addressed. |
8 | 51 |
|
9 | 52 | Once everything passes, you can commit successfully! |
0 commit comments