Thank you for your interest in contributing to CypherGoat CLI! This document provides guidelines and instructions for contributing.
- Getting Started
- Development Setup
- Coding Standards
- Testing
- Building
- Submitting Changes
- Security
- Questions
- Go 1.25 or later
- Task runner (https://taskfile.dev)
- Git
# Clone the repository
git clone https://github.com/moralpriest/cyphergoat-cli.git
cd cyphergoat-cli
# Install Task if not already installed
task install:task
# Verify setup
task help- Go to https://github.com/moralpriest/cyphergoat-cli
- Click the "Fork" button
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/cyphergoat-cli.git
cd cyphergoat-cli
git remote add upstream https://github.com/moralpriest/cyphergoat-cli.git# Sync with upstream
git fetch upstream
git checkout main
git merge upstream/main
# Create feature branch
git checkout -b feature/your-feature-nameMake your changes following the coding standards below.
- Use
context.Contextfor all API calls - Use
anyinstead ofinterface{} - Use
slices.SortFuncfor sorting - Use
slicesandmapspackages from stdlib - Wrap errors with
fmt.Errorf("...: %w", err) - Use meaningful variable names
- Keep functions small and focused
- Run
task lintbefore committing - Follow Go's standard formatting (
go fmt) - Add comments for exported functions
- Keep line length reasonable (max ~120 characters)
// Good
func FetchEstimateFromAPI(ctx context.Context, coin1, coin2 string, amount float64, best bool, network1, network2 string) ([]Estimate, error) {
// Implementation
}
// Avoid - no context, unclear naming
func api(coin1, coin2 string, amount float64) ([]Estimate, error) {
// Implementation
}# Run all tests with race detector
task test
# Quick test (no race detector)
task test:short- Write tests for new functionality
- Use table-driven tests when appropriate
- Test edge cases and error conditions
- Aim for meaningful coverage
func TestFetchEstimate(t *testing.T) {
tests := []struct {
name string
input string
want int
wantErr bool
}{
{
name: "valid response",
input: mockValidResponse,
want: 3,
wantErr: false,
},
{
name: "invalid json",
input: "invalid",
want: 0,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test implementation
})
}
}# Build for current platform
task build
# Build for all platforms
task build:all
# Build for specific platform
task build:linux
task build:macos
task build:windows
task build:macos:arm64# Verify SLSA provenance (requires Cosign)
task verify
# Verify checksums
task verify:checksum# Stage changes
git add .
# Commit with descriptive message
git commit -m "feat: add support for privacy coin DERO
- Add DERO to coin ID mapping
- Update price service with DERO support
- Add tests for DERO price fetching
Closes #XX"Follow Conventional Commits:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test additions/changeschore: Maintenance tasks
git push origin feature/your-feature-name- Go to https://github.com/moralpriest/cyphergoat-cli
- Click "New Pull Request"
- Select your branch
- Fill in the PR template
- Submit
- Tests pass (
task test) - Linting passes (
task lint) - Code is properly formatted
- Documentation updated
- Clear description of changes
- Never commit API keys or secrets
- Use environment variables for sensitive data
- Add
.envto.gitignore
When adding support for privacy coins:
- Ensure no user data is leaked
- Follow best practices for crypto handling
- Consider supply chain security
- Document any trust assumptions
For security vulnerabilities, please:
- Do NOT open a public issue
- Email: security@your-domain.com
- Or use GitHub's private vulnerability reporting
- Check existing Issues
- Check Documentation
- Open a new issue with your question
- GitHub Issues for bugs and feature requests
- Discussions for questions and ideas
- Keep discussions public when possible
Your contributions make CypherGoat CLI better for everyone. We appreciate your time and effort!