|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: "Contributing" |
| 4 | +nav_order: 4 |
| 5 | +--- |
| 6 | + |
| 7 | +# Contribution Guidelines |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +Thank you for considering contributing to the `proper-tags` package! Here's a comprehensive guide to help you through the process. |
| 12 | + |
| 13 | +## Setup |
| 14 | + |
| 15 | +1. **Fork the Repository**: Use the GitHub interface to fork this repository to your account. |
| 16 | +2. **Clone the Fork**: On your local machine, open a terminal or command prompt. Use the following command to clone the forked repository: |
| 17 | + `git clone https://github.com/hexagon/proper-tags.git` |
| 18 | +3. **Navigate to the Repository**: Change to the project directory using: |
| 19 | + `cd proper-tags` |
| 20 | +4. **Install Dependencies**: To ensure you have all the required dependencies, run: |
| 21 | + `npm ci` |
| 22 | + |
| 23 | +## Working on Your Contribution |
| 24 | + |
| 25 | +1. **Create a New Branch**: Always create a new branch for your work to ensure master remains clean. Use: |
| 26 | + `git checkout -b feature/<feature-name>` or `git checkout -b bugfix/<bug-name>` |
| 27 | +2. **Stay Updated**: Ensure you regularly pull the latest changes from the upstream repository to keep your fork up-to-date: |
| 28 | + `git pull origin master` |
| 29 | + |
| 30 | +## Tests |
| 31 | + |
| 32 | +1. **Writing Tests**: Make sure you include tests that cover any new logic or features you add. A good test not only confirms the correct behavior but can also serve as documentation for how a certain feature works. |
| 33 | +2. **Running Tests**: This project uses [AVA](https://github.com/sindresorhus/ava) for testing. To run tests, execute: |
| 34 | + `npm test` |
| 35 | +3. **Testing Convention**: The project is set up to search for test files in the `src` directory that have the `.test.js` extension. |
| 36 | + |
| 37 | +## Code Style and Quality |
| 38 | + |
| 39 | +1. **Coding Standards**: Adhere to the code style and patterns established in the project. This ensures consistency and readability across all contributions. |
| 40 | +2. **Linting**: The project uses [Prettier](https://github.com/prettier/prettier) and [ESLint](https://github.com/eslint/eslint) to maintain a consistent code style. Before committing your changes, ensure your code adheres to the rules. Run: |
| 41 | + `npm run lint` |
| 42 | +3. **Auto-fixing Issues**: Some linting issues can be automatically fixed. Use the following command to attempt auto-fixes: |
| 43 | + `npm run lint:fix` |
| 44 | + |
| 45 | +## Committing and Pushing Changes |
| 46 | + |
| 47 | +1. **Commit Messages**: Write clear and concise commit messages describing the changes you made. |
| 48 | +2. **Atomic Commits**: Make sure each commit contains related changes. Avoid bundling unrelated changes into a single commit. |
| 49 | +3. **Push Your Changes**: Once you're ready to submit your changes, push the branch to your forked repository: |
| 50 | + `git push origin feature/<feature-name>` |
| 51 | + |
| 52 | +## Submitting a Pull Request |
| 53 | + |
| 54 | +1. **Open a Pull Request**: Navigate to the GitHub page of your forked repository and click on the "New pull request" button. |
| 55 | +2. **Describe Your Changes**: In the pull request description, provide a detailed explanation of the changes you've made. If your PR is fixing a bug, provide steps to reproduce the bug. |
| 56 | +3. **Wait for Review**: Maintainers of the `proper-tags` package will review your pull request. Address any feedback or changes requested. |
| 57 | + |
| 58 | +## Final Notes |
| 59 | + |
| 60 | +- Please ensure your code doesn't introduce any regressions by running the full test suite before submitting a PR. |
| 61 | +- Always reference relevant issues or discussions in your pull requests. |
| 62 | +- Contributions aren't just about code! If you find a typo, a confusing piece of documentation, or have ideas for improving the project structure, we'd love to hear from you. |
| 63 | + |
| 64 | +Thank you for helping improve `proper-tags`! |
| 65 | +``` |
0 commit comments