Contributing
Thank you for your interest in contributing to Code Search! This guide will help you get started.
Ways to Contribute
Section titled “Ways to Contribute”- Bug Reports: Report issues you encounter
- Feature Requests: Suggest new features
- Documentation: Improve or add documentation
- Code: Fix bugs or implement features
- Testing: Add or improve tests
Getting Started
Section titled “Getting Started”-
Fork the repository on GitHub
-
Clone your fork locally
-
Set up the development environment
-
Create a feature branch
-
Make your changes
-
Submit a pull request
Development Workflow
Section titled “Development Workflow”1. Find an Issue
Section titled “1. Find an Issue”Browse open issues or create a new one:
- Look for
good first issuelabels for beginner-friendly tasks - Check
help wantedfor tasks needing contributors - Discuss in the issue before starting large changes
2. Create a Branch
Section titled “2. Create a Branch”git checkout -b feature/my-new-feature# orgit checkout -b fix/issue-123Branch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentationrefactor/- Code refactoringtest/- Test additions
3. Make Changes
Section titled “3. Make Changes”Follow the coding guidelines:
- Write clear, commented code
- Add tests for new functionality
- Update documentation as needed
- Keep commits focused and atomic
4. Test Your Changes
Section titled “4. Test Your Changes”# Run all testsmake test
# Run lintermake lint
# Run specific testsgo test ./internal/search/...5. Commit Your Changes
Section titled “5. Commit Your Changes”Follow conventional commits:
feat: add search filter for file typefix: handle nil pointer in connection syncdocs: add API authentication guiderefactor: simplify indexer worker logictest: add unit tests for search parserchore: update dependencies6. Submit a Pull Request
Section titled “6. Submit a Pull Request”- Push your branch to your fork
- Open a PR against
main - Fill out the PR template
- Link related issues
Code Guidelines
Section titled “Code Guidelines”Go Code
Section titled “Go Code”// Good: Clear function names, error handlingfunc (s *Service) CreateConnection(ctx context.Context, req CreateConnectionRequest) (*Connection, error) { if err := req.Validate(); err != nil { return nil, fmt.Errorf("validate request: %w", err) }
conn, err := s.repo.Create(ctx, req.ToModel()) if err != nil { return nil, fmt.Errorf("create connection: %w", err) }
return conn, nil}Guidelines:
- Use
context.Contextas first parameter - Wrap errors with context using
fmt.Errorf - Use interfaces for dependencies
- Write table-driven tests
TypeScript Code
Section titled “TypeScript Code”// Good: Typed, clear, documentedinterface SearchResult { repository: string; file: string; matches: Match[];}
export async function search(query: string): Promise<SearchResult[]> { const response = await fetch(`/api/search?q=${encodeURIComponent(query)}`);
if (!response.ok) { throw new Error(`Search failed: ${response.statusText}`); }
return response.json();}Guidelines:
- Use TypeScript strict mode
- Define interfaces for data structures
- Handle errors explicitly
- Use async/await
Documentation
Section titled “Documentation”- Use clear, concise language
- Include code examples
- Keep examples up to date
- Link to related docs
Pull Request Process
Section titled “Pull Request Process”PR Requirements
Section titled “PR Requirements”- All tests pass
- Linter passes
- Documentation updated
- Changelog entry added
- Commits are clean and focused
Review Process
Section titled “Review Process”- Automated checks run
- Maintainer reviews code
- Address feedback
- Approval and merge
After Merge
Section titled “After Merge”Your contribution will be included in the next release!
Issue Guidelines
Section titled “Issue Guidelines”Bug Reports
Section titled “Bug Reports”Include:
- Code Search version
- Steps to reproduce
- Expected vs actual behavior
- Logs or error messages
- Environment details
Feature Requests
Section titled “Feature Requests”Include:
- Use case description
- Proposed solution
- Alternatives considered
- Impact on existing features
Community
Section titled “Community”Communication
Section titled “Communication”- GitHub Issues: Bug reports and features
- GitHub Discussions: Questions and ideas
- Discord: Real-time chat (if available)
Code of Conduct
Section titled “Code of Conduct”- Be respectful and inclusive
- Welcome newcomers
- Provide constructive feedback
- Focus on the code, not the person
Recognition
Section titled “Recognition”Contributors are recognized in:
- CONTRIBUTORS file
- Release notes
- Project documentation
Thank you for contributing!
Next Steps
Section titled “Next Steps”- Development Setup - Set up your environment
- Building - Build process details