Skip to content

Latest commit

 

History

History
129 lines (94 loc) · 2.94 KB

File metadata and controls

129 lines (94 loc) · 2.94 KB

Contributing to Glean CLI

Thank you for your interest in contributing to the Glean CLI! This document provides guidelines and instructions for contributing.

Development Setup

Prerequisites

  • Go 1.24 or higher
  • mise (tool and task runner)
  • Git

Getting Started

  1. Fork and clone the repository:
git clone https://github.com/YOUR-USERNAME/glean-cli.git
cd glean-cli
  1. Install development dependencies:
mise run setup
  1. Build the project:
mise run build

Development Workflow

  1. Create a new branch for your changes:
git checkout -b feature/your-feature-name
  1. Make your changes, following our coding standards and practices.

  2. Run tests:

# Run tests with verbose output
mise run test

# Run tests with colorized summary
mise run test:summary

# Run all checks (lint + test + build)
mise run test:all
  1. Run linters:
# Run linter
mise run lint

# Run linter with auto-fix
mise run lint:fix
  1. Install locally to test your changes:
mise run install
  1. Commit your changes using conventional commit messages:
git commit -m "feat: add new feature"
git commit -m "fix: resolve issue with X"

Available Tasks

Run mise tasks to see all available tasks. Common tasks include:

  • mise run setup: Install required development dependencies
  • mise run build: Build the CLI
  • mise run test:all: Run all checks (used in CI)
  • mise run lint: Run linters
  • mise run lint:fix: Run linters with auto-fix
  • mise run install: Install the CLI locally
  • mise run clean: Clean build artifacts

Pull Request Process

  1. Update documentation (README.md, code comments) if you're changing functionality.
  2. Add tests for any new features.
  3. Ensure all tests pass and linters are clean.
  4. Push your changes and create a pull request.
  5. Fill out the pull request template with all required information.

Code Style

  • Follow standard Go conventions and idioms
  • Use meaningful variable and function names
  • Add comments for public APIs and complex logic
  • Keep functions focused and concise
  • Write tests for new functionality

Testing

  • Write unit tests for new features
  • Use table-driven tests where appropriate
  • Mock external dependencies
  • Aim for high test coverage of critical paths
  • Test both success and error cases

Documentation

  • Update README.md for user-facing changes
  • Add godoc comments for exported functions and types
  • Include examples in documentation where helpful
  • Keep documentation up to date with code changes

Release Process

  1. Update version numbers in relevant files
  2. Create a new release tag
  3. Build and publish new artifacts

Getting Help

  • Open an issue for bugs or feature requests
  • Ask questions in pull requests
  • Be respectful and constructive in discussions

License

By contributing to Glean CLI, you agree that your contributions will be licensed under the MIT License.