Contributing
Guidelines for contributing to tf2report.
Welcome!
We appreciate your interest in contributing to tf2report! This document provides guidelines and best practices for contributing.
Code of Conduct
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
Getting Started
- Fork the repository on GitHub
- Clone your fork locally
- Create a feature branch from
main - Make your changes
- Test thoroughly
- Submit a pull request
Development Setup
git clone https://github.com/your-username/tf2report.git
cd tf2report
make deps
make build
make test
See Development Getting Started for details.
Making Changes
Branch Naming
Use descriptive branch names:
feat/add-xml-format- New featuresfix/parser-error- Bug fixesdocs/update-readme- Documentationtest/add-coverage- Testsrefactor/simplify-config- Refactoring
Commit Messages
Follow conventional commits:
<type>: <description>
[optional body]
[optional footer]
Types:
feat- New featurefix- Bug fixdocs- Documentationtest- Testsrefactor- Code refactoringchore- Maintenance
Examples:
feat: add XML output format
fix: handle empty plan files correctly
docs: update configuration examples
Coding Standards
Follow guidelines in .github/instructions/:
- Go Code - Idiomatic Go practices
- CLI Code - Clear help text, flag naming
- Makefile - Proper phony targets, tabs
Key rules:
- Run
make fmtbefore committing - Run
make testto verify changes - Document all exported functions
- Handle errors properly
- Write tests for new features
Testing
- Write tests for new features
- Update tests for changes
- Run all tests before submitting
make test
make test-coverage
Documentation
Update documentation when:
- Adding new features
- Changing CLI options
- Modifying configuration
- Updating APIs
Files to update:
README.md- Main documentationdocs/*.md- Detailed guides- Code comments - Exported items
- Examples - Usage examples
Pull Request Process
Before Submitting
- Code follows style guidelines
- All tests pass
- New tests added for features
- Documentation updated
- Commits are clean and descriptive
- No merge conflicts
Submitting PR
- Push your branch to your fork
- Create pull request against
main - Fill out PR template completely
- Link related issues if any
PR Description
Include:
- What - What does this change
- Why - Why is it needed
- How - How it works
- Testing - How you tested it
- Screenshots - If UI changes
Example:
## Description
Adds XML output format support.
## Motivation
Users requested XML format for integration with legacy tools.
## Changes
- Added `pkg/report/xml.go` with XMLFormatter
- Updated `NewFormatter()` to support XML
- Added tests in `pkg/report/xml_test.go`
- Updated documentation
## Testing
- Unit tests pass
- Tested with sample plans
- Verified XML output validates
## Related Issues
Closes #123
Review Process
- Automated checks must pass (CI/CD)
- Code review by maintainers
- Address feedback promptly
- Update as needed
- Merge when approved
Types of Contributions
Bug Reports
Open an issue with:
- Clear title
- Steps to reproduce
- Expected vs actual behavior
- Environment details
- Sample input if applicable
Feature Requests
Open an issue with:
- Clear description
- Use case
- Proposed solution
- Alternatives considered
Code Contributions
- Bug fixes
- New features
- Performance improvements
- Test improvements
- Documentation updates
Documentation
- Fix typos
- Improve clarity
- Add examples
- Update outdated info
Development Guidelines
Adding Features
- Discuss first - Open an issue
- Design - Plan the approach
- Implement - Write code
- Test - Add comprehensive tests
- Document - Update docs
- Submit - Create PR
Code Review
When reviewing:
- Be constructive
- Ask questions
- Suggest improvements
- Appreciate contributions
When receiving review:
- Be open to feedback
- Ask for clarification
- Make requested changes
- Thank reviewers
Release Process
Maintainers handle releases:
- Update version
- Update CHANGELOG
- Create release tag
- Build binaries
- Publish release
Questions?
- Check existing documentation
- Search existing issues
- Open a new issue
- Join discussions
License
By contributing, you agree that your contributions will be licensed under the project's license.
Thank You!
Every contribution helps make tf2report better. Thank you for your time and effort!
Next Steps
- Development Getting Started - Setup development environment
- API Reference - Understand the codebase
- Testing - Write effective tests