Welcome and thank you for your interest in contributing to Guardrails! We appreciate all contributions, big or small, from bug fixes to new features. Before diving in, let's go through some guidelines to make the process smoother for everyone.
- If you're fixing a bug or typo, feel free to submit a Pull Request directly.
- For new features or bug fix discussions, open an issue or join our Discord server to chat with the community.
- Clone the repository:
git clone https://github.com/guardrails-ai/guardrails.git
- Enter the project directory:
cd guardrails
- Install the project in developer mode (use a virtual environment if preferred):
make dev
- Install pre-commit:
pre-commit install
Follow these steps before committing your changes:
- Ensure tests pass:
make test
- Format your code:
make autoformat
- Run static analysis:
make type
- Update documentation if needed. Docs are located in the
docs
directory. You can serve docs usingmkdocs serve
.
For convenience, consider installing the pre-commit hooks provided in the repository. These hooks automatically run tests and formatting checks each time you commit, reducing development overhead.
- Ensure all tests pass and code is formatted.
- Create a pull request with a clear description of your changes. Link to relevant issues or discussions. Follow this guide if needed.
- Address any failing checks before requesting a review.
- Engage in the code review process and make any necessary changes.
- Celebrate when your pull request is merged! Your changes will be available in the next Guardrails release.
Thank you for your contribution and happy coding!
Docs are served via docusaurus. To serve docs locally, run the following
# install dependencies
pip install -e ".[dev]"
# install npm dependencies
npm i
# serve the docs
npm run start
then navigate to localhost:3000
in your browser.