Thank you for your interest in contributing to SpdxTool! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing Guidelines
- Requirements Management
- Submitting Changes
- Release Process
This project adheres to a Code of Conduct that all contributors are expected to follow. Please read CODE_OF_CONDUCT.md before contributing.
- .NET SDK 8.0, 9.0, or 10.0
- Git
- A code editor (Visual Studio, VS Code, or Rider recommended)
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/SpdxTool.git cd SpdxTool -
Add the upstream repository as a remote:
git remote add upstream https://github.com/demaconsulting/SpdxTool.git
-
Restore .NET tools:
dotnet tool restore
-
Build the project:
dotnet build
-
Run the tests:
dotnet test
Create a feature branch for your work:
git checkout -b feature/your-feature-nameUse descriptive branch names:
feature/for new featuresfix/for bug fixesdocs/for documentation changesrefactor/for code refactoringtest/for test improvements
- Make your changes in small, logical commits
- Write clear, descriptive commit messages
- Keep commits focused on a single change
- Run tests frequently to catch issues early
Before submitting your changes, run the following checks:
# Build the project
dotnet build --configuration Release
# Run unit tests
dotnet test --configuration Release
# Run self-validation tests
dotnet run --project src/DemaConsulting.SpdxTool \
--configuration Release --framework net10.0 --no-build -- --validate
# Generate code coverage (optional)
dotnet test --collect:"XPlat Code Coverage"The CI pipeline will also run markdown linting and spell checking on all documentation.
- Follow the
.editorconfigsettings in the repository - Use meaningful variable and method names
- Keep methods focused and concise (prefer < 50 lines)
- Add XML documentation comments for public APIs
- Use nullable reference types appropriately
- One class per file
- Organize using directives (System.* first, then others alphabetically)
- Group related functionality together
- Keep file length reasonable (prefer < 500 lines)
- All public APIs must have XML documentation comments
- Include
<summary>,<param>,<returns>, and<exception>tags as appropriate - Write clear, concise documentation
- Update documentation when changing functionality
- Use exceptions for exceptional conditions
- Throw specific exception types when appropriate
- Use
CommandUsageExceptionfor command usage errors - Use
CommandErrorExceptionfor command execution errors - Include helpful error messages
- Tests are located in
test/DemaConsulting.SpdxTool.Tests/ - Test files follow the naming convention:
[Component]Tests.cs - Use MSTest framework attributes:
[TestClass],[TestMethod]
- Follow the AAA (Arrange, Act, Assert) pattern
- Write descriptive test method names that explain what is being tested
- Each test should verify one specific behavior
- Use meaningful assertion messages
- Clean up resources in test cleanup methods if needed
- Aim for high test coverage (> 80%)
- All new features must include tests
- Bug fixes should include regression tests
- Test both success and failure scenarios
# Run all unit tests
dotnet test --configuration Release
# Run tests for a specific framework
dotnet test --configuration Release --framework net8.0
# Run specific unit test
dotnet test --filter "FullyQualifiedName~YourTestName"
# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage"# Run self-validation tests
dotnet run --project src/DemaConsulting.SpdxTool \
--configuration Release --framework net10.0 --no-build -- --validateSpdxTool uses DemaConsulting.ReqStream for requirements traceability:
- All requirements are defined in
requirements.yaml - Each requirement must be linked to test cases
- Run
dotnet reqstreamto generate requirements documentation - Use the
--enforceflag to ensure all requirements have test coverage
-
Ensure all tests pass
-
Verify code builds without warnings
-
Update documentation if needed
-
Add tests for new functionality
-
Rebase your branch on the latest upstream main:
git fetch upstream git rebase upstream/main
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a pull request on GitHub
-
Fill out the pull request template completely
-
Link any related issues
-
Wait for review and address feedback
- Provide a clear description of the changes
- Include motivation and context
- Reference related issues
- Keep pull requests focused and reasonably sized
- Respond to review comments promptly
- Be open to suggestions and constructive feedback
Releases are managed by project maintainers following these steps:
- Update version numbers in project files
- Create a release branch
- Tag the release
- Build and publish NuGet packages
- Create a GitHub release with auto-generated build notes
Contributors do not need to worry about versioning or releases.
If you have questions about contributing, please:
- Check existing documentation
- Search for similar issues or discussions
- Open a new discussion on GitHub
- Contact the maintainers
Thank you for contributing to SpdxTool!