Thank you for your interest in contributing to ResultObject! This document provides guidelines and information about contributing to this Unity package.
By participating in this project, you are expected to uphold our Code of Conduct:
- Be respectful and inclusive
- Exercise empathy and kindness
- Accept constructive criticism
- Focus on what is best for the community
- Show courtesy and respect towards other community members
If you find a bug, please create an issue on GitHub with the following information:
- Clear and descriptive title
- Detailed description of the bug
- Steps to reproduce
- Expected behavior
- Actual behavior
- Unity version and any relevant environment details
- Code samples or test cases demonstrating the issue
We welcome suggestions for enhancements! When creating an enhancement suggestion, please include:
- Clear and descriptive title
- Detailed explanation of the proposed functionality
- Any potential implementation approaches you've considered
- Example use cases
- Why this enhancement would be useful to most users
- Fork the repository
- Create a new branch from
main
for your changes - Make your changes following our coding standards
- Write or update tests as needed
- Update documentation as needed
- Submit a pull request
All pull requests must:
- Target the
main
branch - Include adequate tests
- Update relevant documentation
- Follow the existing code style
- Include XML documentation for public APIs
- Pass all existing tests
- Not decrease code coverage
- Include relevant updates to the changelog
- Follow C# coding conventions
- Use meaningful names for variables, methods, and classes
- Keep methods focused and concise
- Write self-documenting code
- Add comments only when necessary to explain complex logic
- Use XML documentation for all public APIs
-
Immutability
- All new types should be immutable
- Use readonly fields and properties
- Return new instances instead of modifying existing ones
-
Thread Safety
- All public APIs must be thread-safe
- Document any thread-safety considerations
-
Performance
- Minimize allocations
- Use value types appropriately
- Consider using struct for small, simple types
- Profile performance-critical code
-
Error Handling
- Use the Result pattern consistently
- Avoid throwing exceptions except for truly exceptional cases
- Document all possible error conditions
-
Testing
- Write unit tests for all new functionality
- Follow the existing test structure
- Include both positive and negative test cases
- Test edge cases and error conditions
All public APIs must include XML documentation with:
/// <summary>
/// Clear description of purpose
/// </summary>
/// <remarks>
/// Additional information about usage, implementation, etc.
/// </remarks>
/// <param name="paramName">Parameter description</param>
/// <returns>Description of return value</returns>
/// <exception cref="ExceptionType">When exception can occur</exception>
/// <example>
/// Usage example in code
/// </example>
- Place tests in the
ResultObject.Tests
assembly - Follow the existing test structure and naming conventions
- Use descriptive test names that indicate:
- The scenario being tested
- The expected behavior
- Any important conditions
- Use the Arrange-Act-Assert pattern
- Keep tests focused and independent
- Use meaningful test data
- Update README.md for significant changes
- Update API documentation for new features
- Add migration guides for breaking changes
- Update examples to reflect changes
- Keep documentation clear and concise
- Use clear and meaningful commit messages
- Follow conventional commits format:
feat: add new feature
fix: resolve specific issue
docs: update documentation
test: add or modify tests
refactor: improve code structure
perf: improve performance
style: format code
-
Fork and Clone
git clone https://github.com/yourusername/ResultObjectForUnity.git cd ResultObjectForUnity
-
Create a Branch
git checkout -b feature/your-feature-name
-
Make Changes
- Write code
- Add tests
- Update documentation
-
Test
- Run all tests
- Ensure no existing tests are broken
- Verify code coverage
-
Submit
- Push changes to your fork
- Create a pull request
- Respond to review feedback
By contributing, you agree that your contributions will be licensed under the MIT License.
If you have questions about contributing, please create a discussion in the GitHub repository.
Thank you for helping improve ResultObject!