diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-10 22:24:29 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-10 22:24:29 -0400 |
| commit | 3a5577cba042baee9cbe33144553644d80473f2e (patch) | |
| tree | 5193292d2d9737e0f3ca1113c73d9a12b8d7d998 | |
| parent | Add build status badge (diff) | |
| download | cli-3a5577cba042baee9cbe33144553644d80473f2e.zip | |
Add initial CONTRIBUTING.md
| -rw-r--r-- | CONTRIBUTING.md | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c8dd36c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,158 @@ +# Contributing to Bolt + +Thank you for your interest in contributing to Bolt! This document provides guidelines and instructions for contributing to the project. + +## Getting Started + +Bolt is hosted on [SourceHut](https://sr.ht/~eugenetriguba/Bolt/). If you're new +to SourceHut, here are some helpful resources: +- [git.sr.ht quickstart](https://man.sr.ht/git.sr.ht/) +- [email-based workflow guide](https://man.sr.ht/hg.sr.ht/email.md) + +You do not need an account on SourceHut to contribute. + +## Ways to Contribute + +There are many ways to contribute to Bolt: + +- **Bug Reports**: Submit bug reports to the [issue + tracker](https://todo.sr.ht/~eugenetriguba/bolt-issues) +- **Feature Requests**: Propose new features via the issue tracker +- **Code Contributions**: Submit patches via email +- **Documentation**: Improve documentation, fix typos, or add examples +- **Testing**: Test Bolt with different databases and report issues + +## Development Setup + +### Prerequisites + +- Go 1.23.0 or later +- Docker (for running database integration tests) +- git + +### Initial Setup + +1. Clone the repository: +```bash +git clone https://git.sr.ht/~eugenetriguba/bolt +cd bolt +``` + +2. Install dependencies: +```bash +go mod download +``` + +3. Build the project: +```bash +go build -o bolt ./cmd/bolt +``` + +### Running Tests + +Bolt has integration tests for all supported databases. The test suite uses docker containers to run database instances. + +Run all tests: +```bash +./scripts/test.sh +``` + +Run tests for a specific database: +```bash +./scripts/test.sh postgres +./scripts/test.sh mysql +./scripts/test.sh mssql +./scripts/test.sh sqlite3 +``` + +## Submitting Patches + +Bolt uses an [email-based workflow]((https://git-send-email.io/)) for +accepting contributions. +- Patches are submitted via email to the [bolt-devel mailing +list](https://lists.sr.ht/~eugenetriguba/bolt-devel). +- Discussions of new features can be proposed in [bolt-discuss +mailing list](https://lists.sr.ht/~eugenetriguba/bolt-devel) + +### Step 1: Configure Git + +Set up git send-email if you haven't already: + +```bash +git config --global sendemail.smtpserver smtp.example.com +git config --global sendemail.smtpuser your-email@example.com +git config --global sendemail.smtpencryption tls +git config --global sendemail.smtpserverport 587 +``` + +For detailed email configuration, see the [git send-email tutorial]. + +### Step 2: Create Your Changes + +1. Create a new branch for your changes: +```bash +git checkout -b your-feature-name +``` + +2. Make your changes and commit them: +```bash +git add . +git commit +``` + +3. Write a clear commit message following this format: +``` +Short (50 chars or less) summary + +More detailed explanatory text, if necessary. Wrap it to about 72 +characters. The blank line separating the summary from the body is +critical. + +Explain the problem that this commit is solving. Focus on why you +are making this change as opposed to how. The code explains how. + +Signed-off-by: Your Name <your-email@example.com> +``` + +### Step 3: Send Your Patch + +Send your patch to the mailing list: + +```bash +git send-email --to=~eugenetriguba/bolt-devel@lists.sr.ht HEAD^ +``` + +To send multiple commits: +```bash +git send-email --to=~eugenetriguba/bolt-devel@lists.sr.ht origin/main..HEAD +``` + +## Code Guidelines + +### Style + +- Run `go fmt` on your code before committing + +### Testing + +- New features must include tests +- Bug fixes should include a test that would have caught the bug +- Integration tests should cover all supported databases when applicable +- Ensure all tests pass before submitting your patch + +### Documentation + +- Update the README.md if you're adding new features or changing behavior +- Include code comments for complex logic +- Update CHANGELOG.md with your changes (Add an "Unreleased" section if it + doesn't exist) + +## Questions? + +If you have questions about contributing, you can: + +- Ask on the [bolt-discuss mailing list](https://lists.sr.ht/~eugenetriguba/bolt-discuss) +- Open a ticket on the [bolt-issues issue + tracker](https://todo.sr.ht/~eugenetriguba/bolt-issues) +- Check the [project page](https://sr.ht/~eugenetriguba/Bolt/) for additional resources + |