Contributing
Contributions to version are welcome. This guide covers the project conventions and workflow.
Development Environment
Prerequisites
- JDK: 17.0.17 or later
- Scala: 3.7.4
- Git: For version resolution tests
- NodeJS: For JS Platform tests
- Clang / LLVM: For Native Platform tests
Running Tests
sbt test # All tests
sbt version-jvm/test # All JVM Platform Modules
sbt version-native/test # All Native Platform Modules
sbt version-js/test # All JS Platform Modules
Tests run on JVM, Scala.js, and Scala Native platforms.
Code Style
Formatting and Linting
sbt format # Apply scalafmt + scalafix + license headers
sbt check # Verify formatting compliance
Architecture
Module Structure
| Module | Scope | Dependencies |
|---|---|---|
version |
Core SemVer model | boilerplate |
version-cli-core |
Resolution engine | version, os-lib |
version-cli |
CLI application | version-cli-core, scopt |
sbt-version |
sbt plugin | version-cli-core |
version-codecs-* |
Serialisation | version, codec library |
version-zio-prelude |
Type classes | version, zio-prelude |
version-testkit |
Test utilities | version, munit |
Version Resolution
The resolution engine in version-cli-core follows the Technical Specification. Key components:
- version.cli.core.parsing.KeywordParser — extracts version directives from commit messages
- version.cli.core.TargetVersionCalculator — computes target version from keywords and validates targets
- version.cli.core.Resolver — orchestrates the full resolution workflow
Pull Request Guidelines
- One concern per PR — focused changes are easier to review
- Include tests — coverage for new functionality and regressions
- Follow existing patterns — consistency aids maintenance
- Update documentation — keep README and docs in sync with changes
- Run static checks —
sbt checkmust pass
Specification Changes
The Technical Specification is normative. If code contradicts the specification, the specification wins. Changes to version resolution behaviour require:
- Specification update with rationale
- Implementation changes
- Comprehensive test coverage
- Documentation updates
Licence
By contributing, you agree that your contributions will be licensed under the Apache License, Version 2.0.
In this article