|
| 1 | +# Contributing to AgentDocstringsGenerator |
| 2 | + |
| 3 | +First off, thank you for considering contributing to AgentDocstringsGenerator! It's people like you that make this such a great tool. |
| 4 | + |
| 5 | +This document provides guidelines for contributing to the project. Please feel free to propose changes to this document in a pull request. |
| 6 | + |
| 7 | +## Table of Contents |
| 8 | + |
| 9 | +- [How Can I Contribute?](#how-can-i-contribute) |
| 10 | + - [Reporting Bugs](#reporting-bugs) |
| 11 | + - [Suggesting Enhancements](#suggesting-enhancements) |
| 12 | + - [Pull Requests](#pull-requests) |
| 13 | +- [Development Workflow](#development-workflow) |
| 14 | + - [Branching Model](#branching-model) |
| 15 | + - [Development Steps](#development-steps) |
| 16 | + - [Updating the Changelog](#updating-the-changelog) |
| 17 | +- [Release Process (for maintainers)](#release-process-for-maintainers) |
| 18 | +- [Styleguides](#styleguides) |
| 19 | + |
| 20 | +## How Can I Contribute? |
| 21 | + |
| 22 | +We value community contributions and appreciate your help. Please be respectful in all your interactions. |
| 23 | + |
| 24 | +### Reporting Bugs |
| 25 | + |
| 26 | +If you find a bug, please ensure it hasn't already been reported by searching on GitHub under [Issues](https://github.com/Artemonim/AgentDocstrings/issues). If you can't find an open issue addressing the problem, please open a new one. Include a clear title, a detailed description, and a code sample or test case that demonstrates the issue. |
| 27 | + |
| 28 | +### Suggesting Enhancements |
| 29 | + |
| 30 | +If you have an idea for an enhancement, please open an issue to discuss it first. This allows us to coordinate our efforts and ensure the proposed changes align with the project's goals. |
| 31 | + |
| 32 | +### Pull Requests |
| 33 | + |
| 34 | +We welcome pull requests. Please follow these steps to have your contribution considered: |
| 35 | + |
| 36 | +1. Follow the [Development Workflow](#development-workflow). |
| 37 | +2. Ensure that your code adheres to the [Styleguides](#styleguides). |
| 38 | +3. Make sure all tests pass. |
| 39 | +4. Fill out the pull request template provided. |
| 40 | + |
| 41 | +## Development Workflow |
| 42 | + |
| 43 | +This project uses a GitFlow-like branching model. |
| 44 | + |
| 45 | +### Branching Model |
| 46 | + |
| 47 | +- **`master`**: This branch contains the latest stable release. Direct pushes are not allowed. |
| 48 | +- **`dev`**: This is the main development branch. All feature branches should be created from `dev`, and all pull requests should be submitted to `dev`. |
| 49 | +- **`feature/*`**: For new features. Branched from `dev`. Example: `feature/new-parser`. |
| 50 | +- **`fix/*`**: For bug fixes. Branched from `dev`. Example: `fix/off-by-one-error`. |
| 51 | +- **`release/*`**: For preparing new releases. Branched from `dev`. Merged into `master`. |
| 52 | + |
| 53 | +### Development Steps |
| 54 | + |
| 55 | +1. **Fork** the repository on GitHub. |
| 56 | +2. **Clone** your fork locally: `git clone https://github.com/YOUR_USERNAME/AgentDocstrings.git` |
| 57 | +3. **Set up the environment**: |
| 58 | + ```bash |
| 59 | + cd AgentDocstrings |
| 60 | + pip install -e .[dev] |
| 61 | + ``` |
| 62 | +4. **Create a new branch** from `dev`: |
| 63 | + ```bash |
| 64 | + git checkout dev |
| 65 | + git pull origin dev |
| 66 | + git checkout -b feature/your-amazing-feature |
| 67 | + ``` |
| 68 | +5. **Make your changes**. Write clean, readable code. |
| 69 | +6. **Add or update tests** for your changes in the `tests/` directory. |
| 70 | +7. **Run tests** to ensure everything is working correctly: `python -m pytest` |
| 71 | +8. **Update the Changelog** `NextRelease` section. |
| 72 | +9. **Commit** your changes. Use a clear and descriptive commit message. |
| 73 | +10. **Push** your branch to your fork on GitHub: `git push origin feature/your-amazing-feature` |
| 74 | +11. **Open a Pull Request** to the `dev` branch of the main repository. |
| 75 | + |
| 76 | +### Updating the Changelog |
| 77 | + |
| 78 | +For every change that affects the user, you must add an entry to the `CHANGELOG.md` file under the `[NextRelease]` section. Follow the format of existing entries. |
| 79 | + |
| 80 | +Example: |
| 81 | + |
| 82 | +```markdown |
| 83 | +## [NextRelease] |
| 84 | +
|
| 85 | +### TypeOfChange |
| 86 | +
|
| 87 | +- **Your Awesome Feature**: A brief description of what you've added. |
| 88 | +``` |
| 89 | +
|
| 90 | +## Release Process (for maintainers) |
| 91 | +
|
| 92 | +The release process is partially automated. |
| 93 | +
|
| 94 | +1. Create a release branch from `dev`: `git checkout -b release/x.y.z` (e.g., `release/1.4.0`). |
| 95 | +2. Update the version using `bump-my-version`: |
| 96 | + ```bash |
| 97 | + # For a patch, minor, or major release |
| 98 | + bump-my-version patch/minor/major |
| 99 | + ``` |
| 100 | + This command will update the version in `pyproject.toml` and update the `CHANGELOG.md`, replacing `[NextRelease]` with the new version tag. |
| 101 | +3. Commit the version bump: `git commit -am "chore: release v.x.y.z"` |
| 102 | +4. Push the release branch: `git push origin release/x.y.z` |
| 103 | +5. Open a Pull Request from the `release/x.y.z` branch to `master`. |
| 104 | +6. Once the PR is merged into `master`, the `release-automation` workflow will automatically: |
| 105 | + - Create a Git tag (e.g., `v1.4.0`). |
| 106 | + - Create a GitHub Release with the notes from `CHANGELOG.md`. |
| 107 | + - Create a Pull Request to merge `master` back into `dev`. |
| 108 | +7. The `release.yml` workflow will then automatically publish the package to PyPI upon the creation of the GitHub Release. |
| 109 | +
|
| 110 | +## Styleguides |
| 111 | +
|
| 112 | +Please follow the coding style of the project to maintain consistency. |
| 113 | +
|
| 114 | +- **Python**: [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), formatted with `black`. |
| 115 | +- **Comments**: Use [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) style. |
| 116 | +- **Docstrings**: Use Google Style Docstrings. |
0 commit comments