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

  1. Fork the repository on GitHub
  2. Clone your fork locally:
    git clone https://github.com/DevPossible/DevPossible.Ton.git
    cd DevPossible.Ton
  3. Create a feature branch:
    git checkout -b feature/your-feature-name
  4. Make your changes
  5. Run tests:
    dotnet test
  6. Commit your changes:
    git commit -m "Add: Description of your changes"
  7. Push to your fork:
    git push origin feature/your-feature-name
  8. 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

  1. Ensure all tests pass
  2. Update documentation if needed
  3. Add your changes to the CHANGELOG
  4. Ensure your PR description clearly describes the problem and solution
  5. Reference any related issues
  6. Wait for code review
  7. Address review comments
  8. 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.