Thank you for your interest in contributing to go-config-diff! This document provides guidelines and instructions for contributing.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/go-config-diff.git - Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests:
make test - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Create a Pull Request
- Go 1.24 or later
- Make (optional, for using Makefile targets)
make buildmake testmake run- Follow standard Go conventions
- Use
gofmtto format your code - Write meaningful commit messages
- Add comments for complex logic
- Keep functions focused and small
- Write tests for new features
- Ensure all tests pass before submitting PR
- Add test cases for edge cases
- Update existing tests if behavior changes
pkg/
ast/
ast.go
ast_test.go # Tests for AST functionality
parser/
parser.go
parser_test.go # Tests for parsers
diff/
diff.go
diff_test.go # Tests for diff logic
To add support for a new configuration format:
-
Add the format constant to
pkg/parser/parser.go:const FormatXML Format = "xml"
-
Update
DetectFormat()to recognize the file extension -
Implement a parser function:
func parseXML(r io.Reader) (interface{}, error) { // Parse XML and return as interface{} }
-
Add the case to
ParseReader()switch statement -
Add tests in
pkg/parser/parser_test.go -
Add example files in
examples/directory -
Update documentation
- Title: Use a clear, descriptive title
- Description: Explain what changes you made and why
- Tests: Include tests for new functionality
- Documentation: Update README or other docs if needed
- One feature per PR: Keep PRs focused on a single feature or fix
When reporting issues, please include:
- Go version:
go version - Operating system and version
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs
- Sample configuration files (if applicable)
We welcome feature requests! Please:
- Check if the feature already exists
- Search existing issues for similar requests
- Provide a clear use case
- Explain why the feature would be valuable
- All PRs require review before merging
- Address review comments
- Keep the discussion constructive and professional
- PRs may be updated by maintainers to fix minor issues
go-config-diff/
├── cmd/
│ └── go-config-diff/ # CLI entry point
├── pkg/
│ ├── ast/ # Abstract Syntax Tree
│ ├── parser/ # Format parsers
│ ├── diff/ # Comparison logic
│ └── output/ # Output formatters
├── examples/ # Example config files
├── Makefile # Build automation
└── README.md # Documentation
- New format support: Add XML, HOCON, or other formats
- Output formats: Add more output options (HTML, Markdown, etc.)
- Performance: Optimize comparison for large files
- Documentation: Improve examples and guides
- Tests: Add more test coverage
- Bug fixes: Fix reported issues
Feel free to open an issue with your question or reach out to the maintainers.
By contributing, you agree that your contributions will be licensed under the GPL-3.0 License.
Thank you for contributing to go-config-diff! 🎉