-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing
Chris Watson edited this page Nov 20, 2024
·
1 revision
Thank you for your interest in contributing to Goshot! This guide will help you get started with contributing to the project.
By participating in this project, you are expected to uphold our Code of Conduct:
- Be respectful and inclusive
- Exercise consideration and empathy
- Focus on what is best for the community
- Use welcoming and inclusive language
- Be collaborative
- Gracefully accept constructive criticism
.
βββ cmd/
β βββ goshot/ # CLI implementation
β βββ examples/ # Example code
βββ pkg/
β βββ background/ # Background processing
β β βββ background.go # Main background interface
β β βββ color.go # Solid color backgrounds
β β βββ gradient.go # Gradient backgrounds
β β βββ image.go # Image backgrounds
β βββ chrome/ # Window styling and rendering
β β βββ chrome.go # Window chrome rendering
β β βββ macos.go # macOS-specific window chrome
β β βββ windows11.go # Windows 11-specific window chrome
β β βββ utils.go # Utility functions
β βββ fonts/ # Font loading and management
β β βββ fonts.go # Core font functionality
β β βββ fonts_bundled.go # Bundled font support
β β βββ fonts_nobundled.go # Fallback for bundled fonts
β β βββ bundled/ # Bundled font files
β βββ render/ # Final image composition
β β βββ canvas.go # Main rendering canvas
β β βββ export.go # Export functionality
β βββ syntax/ # Syntax highlighting
β βββ syntax.go # Main syntax interface
β βββ render.go # Syntax rendering
βββ go.mod
βββ go.sum
βββ README.md
-
Fork the Repository
- Visit Goshot on GitHub
- Click the "Fork" button in the top-right corner
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/goshot.git cd goshot
-
Set Up Development Environment
- Install Go (1.20 or later)
- Install required dependencies:
go mod download
-
Create a Branch
- Create a branch for your work:
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix
- Create a branch for your work:
-
Make Your Changes
- Write clear, concise commit messages
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
-
Test Your Changes
# Run tests go test ./... # Run linter go vet ./...
-
Submit a Pull Request
- Push your changes to your fork
- Create a Pull Request from your branch
- Fill out the PR template with all relevant information
- Link any related issues
Use one of these prefixes:
-
feat:
for new features -
fix:
for bug fixes -
docs:
for documentation changes -
test:
for test changes -
refactor:
for code refactoring -
chore:
for routine tasks and maintenance
Example: feat: add gradient background support
Include:
- What changes you've made
- Why you've made these changes
- How to test the changes
- Any breaking changes
- Screenshots (if relevant)
- Follow the Go Code Review Comments
- Use
gofmt
to format your code - Follow these naming conventions:
// Package names should be short and clear package background // Interface names should usually end in -er type Renderer interface { Render() error } // Getter methods should not include Get func (c *Canvas) Size() (width, height int) // Acronyms should be all caps var HTTPClient *http.Client
- Write clear, concise documentation
- Include examples where appropriate
- Use proper markdown formatting
- Keep line length under 100 characters
- Use code blocks with language specifiers
Follow these guidelines:
<type>(<scope>): <subject>
<body>
<footer>
Example:
feat(background): add gradient background support
Implement linear and radial gradient backgrounds with customizable
colors and stops. Include tests and documentation.
Closes #123
-
Unit Tests
- Write tests for new functionality
- Follow table-driven test patterns
- Use meaningful test names
func TestGradientBackground_Render(t *testing.T) { tests := []struct { name string gradient *GradientBackground want image.Image wantErr bool }{ // test cases... } // ... }
-
Integration Tests
- Test interactions between components
- Use realistic test data
- Clean up test resources
-
Code Documentation
- Document all exported types and functions
- Include examples in documentation
- Use complete sentences
// GradientBackground represents a gradient background configuration. // It supports both linear and radial gradients with multiple color stops. type GradientBackground struct { // Type defines whether this is a linear or radial gradient. Type GradientType // Stops contains the color stops for this gradient. Stops []GradientStop }
-
Wiki Documentation
- Keep documentation up-to-date
- Include code examples
- Use proper formatting
- Add screenshots where helpful
When creating an issue:
-
Bug Reports
- Describe the bug clearly
- Include steps to reproduce
- Provide system information
- Include error messages
- Add screenshots if relevant
-
Feature Requests
- Describe the feature
- Explain why it's needed
- Provide example use cases
- Consider implementation details
If you need help:
- Check the documentation
- Search existing issues
- Ask in the discussions
By contributing to Goshot, you agree that your contributions will be licensed under the project's MIT License.
- π₯ Installation
- π CLI Usage (coming soon)
-
π€ Contributing
- Code of Conduct
- Development Workflow
- Project Structure
- Guidelines
- Testing
- Documentation