Contributing

How to contribute to Humus

Thank you for your interest in contributing to Humus! This guide will help you get started.

Ways to Contribute

  • Report Bugs - File issues on GitHub
  • Suggest Features - Start a discussion
  • Improve Documentation - Fix typos, add examples, clarify explanations
  • Write Code - Fix bugs or implement features
  • Share Examples - Contribute example applications

Getting Started

  1. Fork the Repository - https://github.com/z5labs/humus
  2. Clone Your Fork
    git clone https://github.com/YOUR-USERNAME/humus.git
    cd humus
    
  3. Set Up Development Environment - See Development Setup
  4. Create a Branch
    git checkout -b feature/my-feature
    

Development Workflow

Running Tests

# Run all tests with race detection and coverage
go test -race -cover ./...

# Run tests for a specific package
go test -race -cover ./rest

# Run a specific test
go test -race -run TestName ./path/to/package

Linting

# Run golangci-lint
golangci-lint run

# Auto-fix issues where possible
golangci-lint run --fix

Building

# Build all packages
go build ./...

# Verify no build errors
go vet ./...

Code Guidelines

Style

  • Follow standard Go conventions
  • Use gofmt for formatting
  • Run golangci-lint before committing
  • Write clear, descriptive commit messages

Testing

  • Write tests for new features
  • Maintain or improve code coverage
  • Use table-driven tests where appropriate
  • Mock external dependencies

Documentation

  • Document exported types and functions
  • Include examples in godoc
  • Update relevant documentation pages
  • Add package-level documentation

Pull Request Process

  1. Ensure Tests Pass

    go test -race -cover ./...
    
  2. Ensure Linting Passes

    golangci-lint run
    
  3. Update Documentation - If you’re adding features or changing behavior

  4. Write a Clear PR Description

    • What does this PR do?
    • Why is this change needed?
    • How was it tested?
  5. Link Related Issues - Use “Fixes #123” or “Relates to #456”

  6. Be Responsive - Address review comments promptly

Code of Conduct

  • Be respectful and inclusive
  • Welcome newcomers
  • Focus on constructive feedback
  • Assume good intentions

Questions?

Resources