Thank you for your interest in contributing to IronJava! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to abide by our Code of Conduct: be respectful, inclusive, and constructive in all interactions.
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/IronJava.git - Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests:
dotnet test - Commit your changes:
git commit -am 'Add new feature' - Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request
- .NET 8.0 SDK or later
- Visual Studio 2022, VS Code, or JetBrains Rider
- Git
dotnet restore
dotnet builddotnet testIronJava/
├── IronJava.Core/ # Main library
│ ├── AST/ # AST node definitions
│ ├── Grammar/ # ANTLR grammar files
│ ├── Parser/ # Parser implementation
│ └── Serialization/ # JSON serialization
├── IronJava.Tests/ # Unit tests
├── IronJava.Benchmarks/ # Performance benchmarks
└── IronJava.Samples/ # Example applications
- Follow Microsoft's C# Coding Conventions
- Use meaningful variable and method names
- Add XML documentation comments to public APIs
- Keep methods focused and under 50 lines when possible
- Use present tense ("Add feature" not "Added feature")
- Use imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit first line to 72 characters
- Reference issues and pull requests when applicable
Example:
Add support for Java 17 switch expressions
- Implement new AST nodes for switch expressions
- Add visitor methods for traversal
- Include comprehensive unit tests
Fixes #123
- Write tests for all new functionality
- Maintain or improve code coverage
- Use descriptive test names that explain what is being tested
- Follow AAA pattern: Arrange, Act, Assert
- Test real-world Java code parsing
- Verify cross-platform compatibility
- Test error handling and edge cases
-
Before Submitting
- Ensure all tests pass
- Update documentation if needed
- Add/update unit tests
- Run code formatting:
dotnet format
-
PR Description
- Clearly describe the changes
- Link related issues
- Include examples if applicable
- List any breaking changes
-
Review Process
- Address reviewer feedback promptly
- Keep discussions focused and professional
- Be open to suggestions and alternative approaches
When adding new AST node types:
- Define the node class in
AST/Nodes/ - Implement visitor methods in
IJavaVisitor - Update visitor base classes
- Add serialization support
- Create unit tests
If modifying the ANTLR grammar:
- Update the
.g4files - Regenerate parser/lexer code
- Update AST builder if needed
- Test with various Java code samples
- Minimize allocations in hot paths
- Use immutable designs where appropriate
- Profile before optimizing
- Add benchmarks for performance-critical code
- Update README.md for user-facing changes
- Add XML documentation to public APIs
- Include code examples in documentation
- Update wiki for major features
- Open an issue for bugs or feature requests
- Use discussions for questions and ideas
- Join our community chat (if available)
Thank you for contributing to IronJava!