Thank you for your interest in contributing to cuid.net! We welcome contributions from the community and are grateful for your support.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Workflow
- Coding Standards
- Pull Request Process
- Versioning and Releases
- Need Help?
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to admin@projects.visus.io.
To contribute to cuid.net, you'll need:
- .NET SDK 10.0 or later (specified in
global.json) - Windows OS (recommended for multi-targeting support)
- While development is possible on macOS/Linux, CI runs on Windows to support all target frameworks
- Git for version control
- A code editor or IDE:
- Visual Studio 2022 (recommended for Windows)
- JetBrains Rider
- Visual Studio Code with C# extension
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/cuid.net.git cd cuid.net - Add the upstream remote:
git remote add upstream https://github.com/visus-io/cuid.net.git
- Restore dependencies:
dotnet restore
- Build the solution:
dotnet build
- Run tests to verify your setup:
dotnet test
If all tests pass, you're ready to start contributing!
If you find a bug, please create a bug report with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Your environment (.NET version, OS, framework target)
- Any relevant code samples or error messages
We welcome feature suggestions! Please create a feature request with:
- A clear description of the feature
- The problem it solves or use case it addresses
- Any alternative solutions you've considered
- Whether you'd be willing to implement it
Documentation improvements are always welcome! This includes:
- Fixing typos or clarifying existing documentation
- Adding code examples
- Improving API documentation (XML comments)
- Updating the README.md or CLAUDE.md
For documentation-only changes, you can submit a pull request directly.
- Check existing issues to see if your change is already being discussed
- Create or comment on an issue before starting significant work
- Follow the development workflow outlined below
- Submit a pull request following our PR guidelines
# Clean build
dotnet clean
dotnet build
# Release build
dotnet build -c Release
# Build for specific framework
dotnet build --framework net8.0# Run all tests
dotnet test
# Run tests for specific framework
dotnet test --framework net8.0
dotnet test --framework net10.0
# Run tests with detailed output
dotnet test --logger "console;verbosity=detailed"
# Run tests with coverage (CI format)
dotnet test -c Release \
--logger:trx \
--results-directory ./TestResults \
-- --coverage --coverage-output-format xml --report-trxImportant notes about tests:
- Tests use TUnit as the test framework
- API surface tests use Verify.TUnit for snapshot testing
- If you make intentional API changes, you may need to regenerate snapshots
- Tests must pass for all target frameworks:
net48,net8.0,net10.0
Before submitting your changes:
-
Ensure the solution builds without errors:
dotnet build -c Release
-
Run all tests:
dotnet test -c Release -
Check for compiler warnings:
- Your changes should not introduce new warnings
- Use
#pragma warning disablesparingly and with justification
-
Verify API surface changes (if applicable):
- API surface tests will detect breaking changes
- Breaking changes require strong justification and major version bump
- Follow the
.editorconfigsettings in the repository - Use C# 14 language features where appropriate
- Write clear, self-documenting code with meaningful names
- Add XML documentation comments for all public APIs
- Keep methods focused and concise (Single Responsibility Principle)
This project targets multiple frameworks:
netstandard2.0netstandard2.1net8.0net10.0
When contributing:
- Use conditional compilation (
#if NETSTANDARD) when necessary - Test on multiple frameworks when possible
- Be mindful of API availability across frameworks
- Avoid dependencies not available on all target frameworks
- Use readonly structs for performance-critical types
- Implement appropriate interfaces (
IEquatable<T>,IComparable<T>, etc.) - Keep dependencies minimal and aligned with project goals
- Add guards using
CommunityToolkit.Diagnostics.Guardfor parameter validation - Centralize messages for consistency (see
Obsoletions.cspattern)
- Write unit tests for all new functionality
- Maintain or improve code coverage
- Use descriptive test names that explain what is being tested
- Follow the Arrange-Act-Assert pattern
- Test edge cases and error conditions
- Use snapshot tests (Verify) for API surface validation
-
Create a feature branch from
main:git checkout -b feature/your-feature-name
-
Make your changes following the coding standards
-
Write or update tests for your changes
-
Commit your changes with clear, descriptive commit messages:
git commit -m "feat: add support for custom length validation"Follow Conventional Commits format:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test additions/changesrefactor:for code refactoringperf:for performance improvementschore:for maintenance tasks
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub:
- Use the provided PR template
- Fill in all relevant sections
- Link related issues
- Ensure all CI checks pass
- Request review from maintainers
-
Respond to feedback:
- Address reviewer comments promptly
- Push additional commits if changes are requested
- Keep the discussion focused and professional
-
After approval:
- A maintainer will merge your PR
- Your contribution will be included in the next release
Before submitting, ensure:
- Code builds without errors
- All tests pass on all target frameworks
- No new compiler warnings
- Added/updated unit tests
- Code coverage maintained or improved
- Updated documentation (README.md, XML comments, CLAUDE.md if needed)
- API surface changes validated with snapshot tests (if applicable)
- Breaking changes documented and justified (if applicable)
- Followed coding standards and style guidelines
- Commit messages are clear and follow conventions
- This project uses MinVer for semantic versioning based on Git tags
- Versions follow Semantic Versioning 2.0.0:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- Releases are automated via GitHub Actions
- Only maintainers can create releases by pushing tags
If you have questions or need assistance:
- Check existing issues and discussions
- Review the documentation:
- README.md - Project overview and usage
- CLAUDE.md - Detailed architecture and development guide
- SECURITY.md - Security policy and reporting
- Ask questions by opening an issue
- Reach out to maintainers via GitHub Discussions (if enabled)
All contributors will be recognized in the project. Thank you for helping make cuid.net better!
By contributing to cuid.net, you agree that your contributions will be licensed under the same license as the project (MIT License).