Thank you for considering contributing to Spockk!
Before starting work on a significant change, please open an issue to discuss your proposal with the maintainers.
- JDK 21: Set the
JDK21environment variable to the JDK path to make it discoverable by Gradle's toolchains. - direnv: Required to load OpenCode conventions (see OpenCode Setup below)
- IntelliJ IDEA: While any IDE with Kotlin support works, working on Spockk specifications may be tricky, as the IDE support is only provided via the Spockk IntelliJ plugin
Spockk uses OpenCode with the pshevche/opencode-conventions-config shared configuration.
-
Fork and clone the repository:
git clone https://github.com/YOUR-USERNAME/spockk.git cd spockk -
Import the project into IntelliJ IDEA (Gradle configuration will be detected automatically)
./gradlew buildThis compiles the code, runs all tests, and performs code quality checks.
# Run all tests
./gradlew test
# Run tests for a specific module
./gradlew :spockk-compiler-plugin:testThe project uses Spotless with ktlint for code formatting:
# Check formatting
./gradlew spotlessCheck
# Apply formatting
./gradlew spotlessApplyCode style is enforced by .editorconfig (2-space indentation, LF line endings).
To test your changes to the IntelliJ plugin:
-
Build the plugin:
./gradlew :spockk-intellij-plugin:build
-
Install in IntelliJ IDEA:
- Navigate to Settings → Plugins → ⚙️ → Install Plugin from Disk
- Select
spockk-intellij-plugin/build/libs/spockk-intellij-plugin-<version>.jar - Restart IntelliJ IDEA
-
Create a feature branch:
git checkout -b feature/my-feature
-
Make your changes and commit with clear messages
-
Ensure all checks pass:
./gradlew build
-
Push to your fork and open a Pull Request with:
- A clear description of the changes
- Reference to related issues (e.g., "Fixes #123")
spockk-compiler-plugin: IR transformations for Kotlin compilerspockk-core: Kotlin-specific specification syntaxspockk-gradle-plugin: Gradle plugin for applying the compiler pluginspockk-intellij-plugin: IntelliJ IDEA integrationspockk-specs: Framework test specificationsspockk-docs: User guide documentation