|
| 1 | +# Contributing to action-reporting-cli |
| 2 | + |
| 3 | +Thanks for your interest in contributing to this project! We welcome contributions from the community and we're glad you're interested in helping improve action-reporting-cli. |
| 4 | + |
| 5 | +This document outlines the process for contributing to the project and provides guidelines to make the contribution process smooth and effective. |
| 6 | + |
| 7 | +## Code of Conduct |
| 8 | + |
| 9 | +By participating in this project, you are expected to uphold our Code of Conduct. Please report unacceptable behavior to [[email protected]](mailto:[email protected]). |
| 10 | + |
| 11 | +## How Can I Contribute? |
| 12 | + |
| 13 | +### Reporting Bugs |
| 14 | + |
| 15 | +Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible: |
| 16 | + |
| 17 | +- A clear and descriptive title |
| 18 | +- Steps to reproduce the behavior |
| 19 | +- Expected behavior versus actual behavior |
| 20 | +- Screenshots or terminal output (if applicable) |
| 21 | +- Environment details (OS, Node.js version, etc.) |
| 22 | +- Command line arguments you used with the tool |
| 23 | + |
| 24 | +### Suggesting Enhancements |
| 25 | + |
| 26 | +Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion: |
| 27 | + |
| 28 | +- Use a clear and descriptive title |
| 29 | +- Provide a detailed description of the proposed functionality |
| 30 | +- Explain why this enhancement would be useful |
| 31 | +- Include code examples or mockups if applicable |
| 32 | + |
| 33 | +### Pull Requests |
| 34 | + |
| 35 | +Follow these steps to submit your contributions: |
| 36 | + |
| 37 | +1. Fork the repository |
| 38 | +2. Create a feature branch (`git checkout -b my-new-feature`) |
| 39 | +3. Make your changes (see [Development Guidelines](#development-guidelines)) |
| 40 | +4. Run tests to ensure they pass (`npm test`) |
| 41 | +5. Commit your changes using a descriptive commit message that follows our [commit message guidelines](#commit-message-guidelines) |
| 42 | +6. Push to your branch (`git push origin my-new-feature`) |
| 43 | +7. Create a new Pull Request |
| 44 | + |
| 45 | +When submitting pull requests that affect functionality, please make sure to update the relevant documentation in the README.md file as well. |
| 46 | + |
| 47 | +## Development Guidelines |
| 48 | + |
| 49 | +### Getting Started |
| 50 | + |
| 51 | +1. Clone the repository: |
| 52 | + |
| 53 | + ```sh |
| 54 | + git clone https://github.com/stoe/action-reporting-cli.git |
| 55 | + cd action-reporting-cli |
| 56 | + ``` |
| 57 | + |
| 58 | +2. Install dependencies: |
| 59 | + |
| 60 | + ```sh |
| 61 | + npm install |
| 62 | + ``` |
| 63 | + |
| 64 | +3. Run tests to verify your setup: |
| 65 | + ```sh |
| 66 | + npm test |
| 67 | + ``` |
| 68 | + |
| 69 | +### Project Structure |
| 70 | + |
| 71 | +- `src/`: Main source code |
| 72 | + - `github/`: GitHub API interaction classes (Enterprise, Owner, Repository, Workflow) |
| 73 | + - `report/`: Report generation modules (CSV, JSON, Markdown) |
| 74 | + - `util/`: Utility functions for logging, caching, and rate limiting |
| 75 | +- `test/`: Unit tests with corresponding structure to src/ |
| 76 | + - `__fixtures__/`: Test data for unit tests |
| 77 | + - `__mocks__/`: Mock implementations for testing |
| 78 | +- `cli.js`: Main entry point for the command-line tool |
| 79 | + |
| 80 | +### Coding Standards |
| 81 | + |
| 82 | +- Follow the existing code style (we use prettier and ESLint) |
| 83 | +- Write documentation for new methods, classes, and functions |
| 84 | +- Include JSDoc comments for public APIs |
| 85 | +- Keep functions focused and modular (generally under 50 lines) |
| 86 | +- Use clear, descriptive variable and function names |
| 87 | +- Handle errors consistently throughout the codebase |
| 88 | +- Keep all lines, including comments, under 120 characters |
| 89 | +- Write tests for all new functionality |
| 90 | + |
| 91 | +### Commit Message Guidelines |
| 92 | + |
| 93 | +We follow the [Gitmoji](https://gitmoji.dev/) convention for commit messages: |
| 94 | + |
| 95 | +- Use the format `<emoji> <description>` |
| 96 | +- Common emojis: |
| 97 | + - ✨ `:sparkles:` for new features |
| 98 | + - 🐛 `:bug:` for bug fixes |
| 99 | + - 📝 `:memo:` for documentation updates |
| 100 | + - 🎨 `:art:` for code style/structure improvements |
| 101 | + - ♻️ `:recycle:` for code refactoring |
| 102 | + - ✅ `:white_check_mark:` for tests |
| 103 | + - 🔧 `:wrench:` for configuration changes |
| 104 | +- Keep descriptions concise and descriptive |
| 105 | +- Use imperative, present tense (e.g., "change" not "changed" or "changes") |
| 106 | + |
| 107 | +Examples: |
| 108 | + |
| 109 | +- `✨ Add new CSV export format for reports` |
| 110 | +- `🐛 Fix pagination issues with large repositories` |
| 111 | +- `📝 Update installation instructions` |
| 112 | +- `♻️ Refactor API client for better performance` |
| 113 | +- `✅ Add tests for pagination handling` |
| 114 | + |
| 115 | +## Testing |
| 116 | + |
| 117 | +- All new features should include corresponding tests |
| 118 | +- Run the test suite before submitting a pull request: `npm test` |
| 119 | +- Ensure your changes don't break existing functionality |
| 120 | +- If you're fixing a bug, consider adding a test that would have caught the bug |
| 121 | + |
| 122 | +## Documentation |
| 123 | + |
| 124 | +- Update the README.md with any necessary changes |
| 125 | +- Document new features, options, or behavior changes |
| 126 | +- Consider updating examples if relevant |
| 127 | +- Use a conversational tone that matches the existing documentation |
| 128 | +- For command examples, use the format shown in the README (e.g., `my-org/my-repo` for repository names) |
| 129 | + |
| 130 | +## Review Process |
| 131 | + |
| 132 | +- All submissions require review |
| 133 | +- You may be asked to make changes before your PR is accepted |
| 134 | +- Once approved, your PR will be merged by a maintainer |
| 135 | + |
| 136 | +## Additional Resources |
| 137 | + |
| 138 | +- [GitHub Pull Request Documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests) |
| 139 | +- [Test documentation](../test/readme.md) for detailed testing information |
| 140 | + |
| 141 | +Thanks for contributing to action-reporting-cli! |
0 commit comments