Thank you for your interest in contributing to HelixToolkit Nex! This document provides guidelines and instructions for contributing to the project.
- .NET 9 SDK
- Vulkan SDK 1.3.296.0 or later
- Git
- Visual Studio 2022 or your preferred IDE with .NET support
To automatically check code formatting before each commit, set up the pre-commit hook:
.\Scripts\setup-git-hooks.ps1This will install a pre-commit hook that:
- Runs code formatting verification before each commit
- Prevents commits with formatting issues
- Provides instructions on how to fix formatting problems
Once installed, the hook will automatically run every time you commit. If formatting issues are detected, the commit will be blocked until you run .\Scripts\format-solution.ps1 to fix them.
Note: You can bypass the hook with git commit --no-verify, but this is not recommended as it may cause CI failures.
This project uses .editorconfig to enforce consistent code style across the codebase. Code formatting is automatically checked in the CI pipeline.
Before committing changes, run the formatting script to ensure your code adheres to the style guidelines:
.\Scripts\format-solution.ps1This will automatically format all code files in the solution according to the rules defined in .editorconfig.
The CI workflow automatically verifies code formatting on all pull requests and pushes. If your code doesn't match the formatting rules, the build will fail with details about which files need formatting.
To avoid CI failures:
- Set up git hooks using
.\Scripts\setup-git-hooks.ps1(recommended) - Run
.\Scripts\format-solution.ps1before committing - Ensure your IDE is configured to respect
.editorconfigsettings - Review the formatting changes before committing
Most modern IDEs (Visual Studio, VS Code, Rider) automatically recognize and apply .editorconfig settings. Make sure this feature is enabled in your IDE.
To build the solution:
dotnet restore Source/HelixToolkit-Nex/HelixToolkit.Nex.slnx
dotnet build Source/HelixToolkit-Nex/HelixToolkit.Nex.slnx --configuration DebugTo run the test suite:
dotnet test Source/HelixToolkit-Nex/HelixToolkit.Nex.slnx --configuration DebugNote: Tests tagged with TestCategory=GPURequired require GPU access and are skipped in CI environments.
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature-name) - Set up git hooks:
.\Scripts\setup-git-hooks.ps1(first time only) - Make your changes
- Commit your changes (formatting will be checked automatically if hooks are set up)
- Build and test your changes locally
- Push to your fork
- Submit a pull request to the
developbranch
- Provide a clear description of the changes and their purpose
- Reference any related issues
- Ensure all CI checks pass (build, tests, code formatting)
- Keep pull requests focused on a single feature or fix
- Update documentation as needed
- Follow the
.editorconfigrules (enforced automatically) - Write clear, self-documenting code with meaningful names
- Add XML documentation comments for public APIs
- Keep methods focused and reasonably sized
- Write unit tests for new functionality
If you have questions or run into issues:
- Check existing GitHub Issues
- Open a new issue with a detailed description
- Join discussions in pull requests and issues
We appreciate your contributions!