Thank you for your interest in contributing to go-output!
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/go-output.git - Add the upstream remote:
git remote add upstream https://github.com/larsartmann/go-output.git - Create a feature branch:
git checkout -b feature/your-feature-name
This project uses a Go multi-module workspace with 14 independent modules.
# Create go.work for local development (gitignored)
cat > go.work << 'EOF'
go 1.26.3
use (
.
./delimited
./d2
./enum
./escape
./graph
./markup
./plantuml
./serialization
./testhelpers
./testhelpers/graphtest
./table
./integration
./examples
)
EOF# Build all modules (from project root with go.work)
go build ./...
# Test all modules
go test ./...
# Test a specific module
go test ./enum/...
# Test with race detector
go test -race ./...
# Test with coverage
go test -cover ./...
# Lint all modules
golangci-lint run ./...Each module is standalone and can be built/tested independently:
cd table && go test ./... && cd ..After changing imports, tidy each affected module:
go mod tidy # Root module
cd enum && go mod tidy && cd .. # Sub-module- Keep changes focused and atomic
- Follow existing code style (enforced by golangci-lint)
- Add tests for new functionality
- Update documentation as needed
- Keep commits small and descriptive
Follow the conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore, perf, ci
Examples:
feat(table): add streaming renderer supportfix(d2): correct SQL table constraint renderingdocs(readme): add registry system documentation
All changes must pass tests:
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run race detector
go test -race ./...
# Run fuzz tests
go test -fuzz=FuzzParseOutputFormat -fuzztime=1m .
go test -fuzz=FuzzMarkdownTable -fuzztime=1m .- All code must pass
golangci-lint run - File size limit: 350 lines
- Test coverage target: 90%+
- No code duplication (threshold: 30 tokens)
- Sub-modules must not import
internal/packages from root
- Update the README.md if you add new features
- Update CHANGELOG.md with your changes (following Keep a Changelog format)
- Ensure all tests pass and linter is clean
- Push your branch and create a pull request
- Respond to review feedback
When reporting issues, include:
- Go version (
go version) - Library version (git commit or tag)
- Minimal reproduction case
- Expected vs actual behavior
Feel free to open an issue for questions or discussions.
By contributing, you agree that your contributions will be licensed under the MIT License.