Thank you for your interest in contributing to the Cooklang Go parser! This document provides guidelines and instructions for contributing.
- Go 1.24 or later
- Task (optional, but recommended)
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/cooklang.git cd cooklang - Install dependencies:
go mod download
# Using Task (recommended)
task test
# Or directly with Go
go test ./...# Using Task (recommended)
task lint
# Or directly with golangci-lint
golangci-lint run# Build the library
go build ./...
# Build the CLI
go build -o bin/cook ./cmd/cookUse descriptive branch names:
feature/description- for new featuresfix/description- for bug fixesdocs/description- for documentation changes
- Follow standard Go conventions
- Run
gofmtorgoimportson your code - Ensure
golangci-lintpasses without errors - Add godoc comments for all exported types, functions, and methods
- Add tests for new functionality
- Ensure all existing tests pass
- Aim to maintain or improve code coverage
Write clear, concise commit messages:
- Use the imperative mood ("Add feature" not "Added feature")
- Keep the first line under 72 characters
- Reference issues when applicable (e.g., "Fix #123")
Examples:
feat: add support for recipe notes
fix: handle empty ingredient quantities
docs: update README with new CLI options
test: add tests for unit conversion edge cases
- Create a feature branch from
main - Make your changes following the guidelines above
- Run tests and linter to ensure everything passes:
task test task lint - Push your branch and create a Pull Request
- Fill out the PR template with a clear description of your changes
- Wait for review - maintainers will review your PR and may request changes
Before submitting, ensure:
- Tests pass (
task testorgo test ./...) - Linter passes (
task lintorgolangci-lint run) - New code has appropriate test coverage
- Documentation is updated if needed
- Commit messages are clear and descriptive
When reporting bugs, please include:
- Go version (
go version) - Operating system
- Steps to reproduce
- Expected vs actual behavior
- Sample recipe file if applicable
When requesting features:
- Describe the use case
- Explain how it relates to the Cooklang specification
- Provide examples if possible
Be respectful and constructive in all interactions. We're all here to build great software together.
If you have questions about contributing, feel free to open an issue for discussion.
By contributing, you agree that your contributions will be licensed under the MIT License.