Contributing to TON
We welcome contributions to the TON File Format specification and its implementations! This guide will help you get started.
Ways to Contribute
1. Report Issues
Found a bug or have a feature request? Open an issue on our GitHub repository:
- Check if the issue already exists
- Provide a clear description of the problem
- Include example TON files if relevant
- Specify the version and platform you're using
2. Improve Documentation
Help make our documentation better:
- Fix typos and grammatical errors
- Add clarifying examples
- Improve explanations of complex concepts
- Translate documentation to other languages
3. Submit Code
Contribute to the implementation:
- Fix bugs
- Add new features
- Improve performance
- Add tests
Development Process
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/DevPossible/DevPossible.Ton.git cd DevPossible.Ton
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes
- Run tests:
dotnet test
- Commit your changes:
git commit -m "Add: Description of your changes"
- Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request
Code Style Guidelines
C# Implementation
- Follow standard C# naming conventions
- Use meaningful variable and method names
- Add XML documentation comments for public APIs
- Keep methods focused and single-purpose
- Write unit tests for new functionality
TON Files
- Use 4 spaces for indentation
- Keep lines under 100 characters when possible
- Use descriptive property names
- Include comments for complex structures
Testing
All code contributions must include appropriate tests:
Unit Tests
[Fact]
public void Should_Parse_Complex_Object()
{
var ton = @"{(config)
name = ""MyApp"",
port = 8080
}";
var document = parser.Parse(ton);
document.RootObject.ClassName.Should().Be("config");
document.RootObject["name"].ToString().Should().Be("MyApp");
document.RootObject["port"].ToInt32().Should().Be(8080);
}
Integration Tests
Test complete scenarios end-to-end, including parsing, validation, and serialization.
Pull Request Process
- Ensure all tests pass
- Update documentation if needed
- Add your changes to the CHANGELOG
- Ensure your PR description clearly describes the problem and solution
- Reference any related issues
- Wait for code review
- Address review comments
- Once approved, your PR will be merged
Community Guidelines
Code of Conduct
We are committed to providing a welcoming and inclusive environment. Please:
- Be respectful and considerate
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Respect differing viewpoints
Communication
- GitHub Issues: For bugs, features, and discussions
- Pull Requests: For code contributions
- Discussions: For general questions and ideas
License
By contributing to TON, you agree that your contributions will be licensed under the MIT License.
Recognition
Contributors will be recognized in:
- The CONTRIBUTORS file
- Release notes for significant contributions
- The project README for major features
Questions?
If you have questions about contributing, feel free to:
- Open a discussion on GitHub
- Review existing issues and PRs for examples
- Check the documentation for guidance
Thank you for contributing to TON! Your efforts help make this project better for everyone.