Thank you for your interest in contributing to Export Trakt for Letterboxd! This document provides comprehensive guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Guidelines
- Release Process
- Community
- License
Please read and follow our Code of Conduct to foster an open and welcoming environment for all contributors.
-
Fork the repository
- Click the "Fork" button on the GitHub repository page
- Clone your fork locally
-
Clone your fork
git clone https://github.com/YOUR-USERNAME/Export_Trakt_4_Letterboxd.git cd Export_Trakt_4_Letterboxd -
Set up the development environment
# Install Go 1.22+ (if not already installed) # macOS (using Homebrew): brew install go # Ubuntu/Debian: sudo apt-get update sudo apt-get install golang-go # Windows: # Download from https://golang.org/dl/ # Verify Go installation go version # Should show Go 1.22 or higher # Install dependencies go mod download go mod tidy
-
Set up pre-commit hooks (optional but recommended)
# Install pre-commit (if available) brew install pre-commit # macOS # or pip install pre-commit # Python users # Install hooks pre-commit install
-
Create a branch for your work
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-number-description
Export_Trakt_4_Letterboxd/
├── cmd/ # 🎯 Command-line applications
│ └── export_trakt/ # Main application entry point
├── pkg/ # 📦 Reusable packages
│ ├── api/ # 🌐 API client for Trakt.tv
│ ├── config/ # ⚙️ Configuration handling
│ ├── export/ # 📊 Export functionality
│ ├── i18n/ # 🌍 Internationalization
│ ├── logger/ # 📝 Logging facilities
│ └── scheduler/ # ⏰ Cron scheduling
├── internal/ # 🔒 Private application code
│ ├── models/ # 🗂️ Data models
│ └── utils/ # 🛠️ Private utilities
├── tests/ # 🧪 Test suites
│ ├── integration/ # Integration tests
│ └── mocks/ # Mock objects for testing
├── locales/ # 🗣️ Translation files
├── config/ # 📋 Configuration examples
├── scripts/ # 🚀 Build and utility scripts
├── .github/ # 🏗️ GitHub workflows and templates
│ ├── workflows/ # CI/CD pipelines
│ └── ISSUE_TEMPLATE/ # Modern issue forms
└── docs/ # 📖 Additional documentation
We use structured issue forms to ensure we get all the information needed to help you effectively.
- Search existing issues first in the Issues
- If no existing issue matches, create a new bug report:
- Use the 🐛 Bug Report template
- Fill out all required sections completely
- Include your version, platform, and configuration
- Provide detailed steps to reproduce
- Add relevant logs (set log level to
debugfor more detail)
We welcome feature suggestions and improvements!
- Check existing feature requests in Issues
- If your idea is new, create a feature request:
- Use the ✨ Feature Request template
- Explain the problem you're trying to solve
- Describe your proposed solution
- Include use cases and examples
- Indicate if you're willing to help implement it
Documentation improvements are always welcome!
- Check for existing documentation issues
- Create a documentation issue:
- Use the 📚 Documentation Issue template
- Specify the type of issue (typo, missing info, unclear instructions)
- Indicate the location of the problem
- Provide specific suggestions for improvement
We use a comprehensive pull request template to ensure quality contributions.
- Update your fork to the latest main branch
- Create a new branch for your changes
- Make your changes following our Development Guidelines
- Add or update tests as needed
- Ensure all tests pass locally
- Update documentation as required
- Test your changes thoroughly
-
Fill out the PR template completely:
- Describe what changes you're introducing
- Explain why these changes are needed
- Link to related issues
- Complete all relevant checklists
-
Required sections include:
- Type of change (bug fix, feature, docs, etc.)
- Testing information
- Documentation updates
- Security considerations
- Automated checks will run (tests, builds, linting)
- Maintainer review will be scheduled
- Address feedback promptly and professionally
- Update your PR as needed
- Celebrate when your PR gets merged! 🎉
- Follow Go best practices and idioms
- Use
gofmtandgoimportsfor consistent formatting - Use meaningful names for variables, functions, and types
- Keep functions focused on a single responsibility
- Write clear comments for complex logic
- Document exported functions and types with Go doc comments
// ExportMovies exports user's movie data from Trakt.tv to CSV format.
// It returns the number of movies exported and any error encountered.
func ExportMovies(ctx context.Context, client *api.Client, config *Config) (int, error) {
if client == nil {
return 0, errors.New("client cannot be nil")
}
// Get user's watched movies
movies, err := client.GetWatchedMovies(ctx)
if err != nil {
return 0, fmt.Errorf("failed to fetch watched movies: %w", err)
}
return len(movies), nil
}We maintain high test coverage across the codebase.
- Write unit tests for new functionality
- Use table-driven tests for multiple scenarios
- Mock external dependencies (API calls, file system)
- Test error conditions and edge cases
- Include integration tests for critical workflows
# Run all tests
go test -v ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Run specific package tests
go test -v ./pkg/api/
# Run tests with race detection
go test -race ./...
# Generate coverage report
./scripts/coverage.shfunc TestExportMovies(t *testing.T) {
tests := []struct {
name string
client *api.Client
want int
wantErr bool
}{
{
name: "nil client",
client: nil,
want: 0,
wantErr: true,
},
// Add more test cases...
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ExportMovies(context.Background(), tt.client, nil)
if (err != nil) != tt.wantErr {
t.Errorf("ExportMovies() error = %v, wantErr %v", err, tt.wantErr)
return
}
if got != tt.want {
t.Errorf("ExportMovies() = %v, want %v", got, tt.want)
}
})
}
}- Update README.md for new features or changed workflows
- Update code documentation for public APIs
- Add configuration examples for new options
- Update CLI help text for new commands or flags
- Consider Wiki updates for complex features
We support multiple languages. When adding user-facing text:
- Add to translation files in
locales/ - Use translation keys instead of hardcoded strings
- Test with different languages if possible
- Update translation documentation
// Good: Use translation key
logger.Info(i18n.Get("export.started"))
// Bad: Hardcoded string
logger.Info("Export started")The project follows Semantic Versioning:
- Major versions (v3.0.0): Breaking changes
- Minor versions (v2.1.0): New features, backward compatible
- Patch versions (v2.0.1): Bug fixes, backward compatible
- Version bump in relevant files
- Update CHANGELOG.md with new version
- Create release PR with all changes
- Automated testing runs on all platforms
- Manual review and approval
- Merge and tag creates automated release
- Docker images are built and published
- GitHub release with binaries is created
- 📖 Documentation: Check our Wiki
- ❓ Questions: Use the Question & Support issue template
- 💬 Discussions: Join GitHub Discussions
- 🐳 Docker: See Docker Hub
- Be respectful and professional
- Follow the Code of Conduct
- Provide context when asking questions
- Search before posting to avoid duplicates
- Use templates for structured communication
Contributors are recognized in:
- GitHub Contributors section
- Release notes for significant contributions
- Special thanks in documentation
- Community highlights for ongoing support
By contributing, you agree that your contributions will be licensed under the project's MIT License.
- Original work by Thierry Beugnet (u2pitchjami)
- Current maintainer: JohanDevl
- Contributors retain copyright on their contributions
- Project license covers the combined work
Ready to contribute? Here's the fast track:
- 🍴 Fork the repo and clone locally
- 🔧 Set up Go 1.22+ and install dependencies
- 🌿 Create a feature branch from main
- 💻 Make your changes following our guidelines
- 🧪 Add tests and ensure they pass
- 📝 Update docs as needed
- 📤 Submit a PR using our template
- 🎉 Celebrate your contribution!
Thank you for helping make Export Trakt 4 Letterboxd better for everyone! 🚀