Thank you for your interest in contributing to Ampel! This document provides guidelines and instructions for contributing.
Be respectful and inclusive. We welcome contributions from everyone regardless of experience level.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/ampel.git - Set up your development environment (see DEVELOPMENT.md)
- Create a feature branch:
git checkout -b feature/your-feature-name
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or fixes
- Write code following the style guidelines below
- Add tests for new functionality
- Update documentation if needed
- Run checks locally before committing:
# Using Make (recommended)
make format # Format all code
make lint # Run all linters
make test # Run all tests
# Or manually:
# Backend
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features
# Frontend
cd frontend
pnpm run lint
pnpm run type-check
pnpm testFollow Conventional Commits:
type(scope): description
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat(api): add endpoint for repository health metrics
fix(frontend): resolve dashboard loading state issue
docs: update deployment instructions for Fly.io
- Ensure all CI checks pass
- Update relevant documentation
- Add tests for new functionality
- Rebase on latest
mainif needed
When opening a PR, include:
- Description: What does this PR do?
- Related Issue: Link to related issue(s)
- Type of Change: Feature, bug fix, docs, etc.
- Testing: How was this tested?
- Checklist:
- Tests added/updated
- Documentation updated
- CI passes
- At least one maintainer review required
- All CI checks must pass
- Discussions should be resolved before merging
- Squash and merge preferred for clean history
- Follow Rust API Guidelines
- Use
rustfmtwith default settings - Address all
clippywarnings - Document public APIs with doc comments
- Use meaningful variable and function names
/// Calculates the health score for a repository based on PR metrics.
///
/// # Arguments
/// * `metrics` - The repository metrics to evaluate
///
/// # Returns
/// A score between 0 and 100
pub fn calculate_health_score(metrics: &RepositoryMetrics) -> u8 {
// Implementation
}- Use functional components with hooks
- Follow ESLint rules configured in the project
- Use TypeScript strict mode
- Prefer named exports for components
- Keep components focused and composable
interface Props {
status: AmpelStatus;
size?: 'sm' | 'md' | 'lg';
}
export function StatusBadge({ status, size = 'md' }: Props) {
// Implementation
}- Use Tailwind CSS utility classes
- Follow the existing color scheme (ampel-green, ampel-yellow, ampel-red)
- Ensure responsive design
- Maintain dark mode support
# Run all tests
cargo test --all-features
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapturecd frontend
# Run all tests
pnpm test
# Run in watch mode
pnpm test -- --watch
# Run with coverage
pnpm test -- --coverageInclude:
- Clear description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, browser, versions)
- Logs or screenshots if applicable
Include:
- Clear description of the feature
- Use case / motivation
- Proposed implementation (if any)
- Alternatives considered
- Open a GitHub Discussion for questions
- Check existing issues and discussions
- Reach out to maintainers
By contributing, you agree that your contributions will be licensed under the MIT License.