Contributing to PortGuard¶
First off, thank you for considering contributing to PortGuard! It's people like you that make PortGuard such a great tool.
Code of Conduct¶
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
How Can I Contribute?¶
Reporting Bugs¶
Before creating bug reports, please check the existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps which reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed after following the steps
- Explain which behavior you expected to see instead and why
- Include logs and configuration files (sanitize sensitive data)
Suggesting Enhancements¶
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a step-by-step description of the suggested enhancement
- Provide specific examples to demonstrate the steps
- Describe the current behavior and explain which behavior you expected to see instead
- Explain why this enhancement would be useful
Pull Requests¶
- Fill in the required template
- Do not include issue numbers in the PR title
- Follow the Go coding style
- Include thoughtfully-worded, well-structured tests
- Document new code
- End all files with a newline
Development Process¶
- Fork the repo
- Create a new branch from
main:git checkout -b feature/my-new-feature - Make your changes
- Run tests:
make test - (Optional) Generate coverage report:
make test-coverage - Run linter:
make lint - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/my-new-feature - Create a new Pull Request
Coding Conventions¶
- Use
gofmtto format your code - Follow Effective Go guidelines
- Write clear commit messages
- Add comments for exported functions and types
- Keep functions small and focused
- Write tests for new functionality
Testing¶
Run all tests (race + coverage):
make test
Generate and view coverage report:
make test-coverage
Questions?¶
Feel free to open an issue with your question or reach out to the maintainers.