Skip to content

ci: add Spotless/detekt quality gate and a Linux test leg - #28

Merged
jamesarich merged 1 commit into
mainfrom
ci/spotless-and-linux-tests
Jul 23, 2026
Merged

ci: add Spotless/detekt quality gate and a Linux test leg#28
jamesarich merged 1 commit into
mainfrom
ci/spotless-and-linux-tests

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

Closes #3.

Wires the two standard quality gaps into the build + CI in one PR.

B — Spotless (ktlint) + detekt (§7.1 / §7.2)

  • Spotless com.diffplug.spotless 8.8.0 with ktlint 1.8.0 over src/**/*.kt and the Gradle build scripts. ktlint reads .editorconfig, so that file stays the single source of Kotlin style.
  • detekt 1.23.8, buildUponDefaultConfig = true, with a small config/detekt/detekt.yml. KMP has no main/test source sets, so detekt is pointed at the src/ tree directly.
  • spotlessApply was run and the reformatting committed before the check was wired (the .editorconfig/ktlint lesson) — pure ktlint whitespace/wrapping churn across the codec, no behavior change.
  • Pre-existing findings in the RFC 8878 engine (lifted verbatim from TAKPacket-SDK) are captured in config/detekt/baseline.xml (11 issues) so the gate blocks new issues while the engine is cleaned up incrementally.
  • Per-file .editorconfig override turns max-line-length off for the Base64/hex fixtures in TestVectors.kt.

Verified locally on JDK 21: ./gradlew spotlessCheck detektBUILD SUCCESSFUL.

D — Linux test leg (§4.2 / §5.1)

  • New ubuntu-latest job that actually executes the JVM/JS/Wasm/linuxX64 tests (jvmTest jsTest wasmJsTest wasmWasiTest linuxX64Test) plus spotlessCheck detekt apiCheck. Today's single macos-latest runner cross-compiles the linuxX64 test binary but never runs it — this closes that gap.
  • The existing macos-latest job is kept unchanged for the Apple/native targets (it is the required status check — not renamed/removed).
  • Reuses the repo's SHA-pinned action refs (no mutable tags); caches ~/.konan for linuxX64Test.

New CI job name

Quality gate & Linux tests (JVM/JS/Wasm/linuxX64) — consider adding it to the branch-protection ruleset as a required status check alongside the existing Build, test & API check (all KMP targets).

Closes #3.

B — Formatting + static analysis (§7.1/§7.2):
- Add Spotless (com.diffplug.spotless 8.8.0) with ktlint 1.8.0 over
  src/**/*.kt and the Gradle build scripts. ktlint reads .editorconfig,
  keeping that file the single source of Kotlin style.
- Add detekt 1.23.8 (buildUponDefaultConfig=true) with a small
  config/detekt/detekt.yml. KMP has no main/test source sets, so detekt
  is pointed at the src/ tree directly.
- Run spotlessApply and commit the reformatting (pure ktlint churn across
  the codec, all whitespace/wrapping — no behavior change) BEFORE wiring
  the check, so CI's spotlessCheck is green from the first run.
- Pre-existing findings in the RFC 8878 engine (lifted verbatim from
  TAKPacket-SDK) are captured in config/detekt/baseline.xml so the gate
  blocks NEW issues while the engine is cleaned up incrementally.
- Add a per-file .editorconfig override turning max-line-length off for
  the Base64/hex fixtures in TestVectors.kt.

D — Linux test leg (§4.2/§5.1):
- Add an ubuntu-latest job that actually EXECUTES the JVM/JS/Wasm/linuxX64
  tests (jvmTest jsTest wasmJsTest wasmWasiTest linuxX64Test) plus
  spotlessCheck, detekt and apiCheck. The existing macos-latest job
  (required status check) is kept unchanged for the Apple/native targets.
- Reuse the repo's SHA-pinned action refs; cache ~/.konan for linuxX64Test.

New CI job name: "Quality gate & Linux tests (JVM/JS/Wasm/linuxX64)".

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich
jamesarich enabled auto-merge July 23, 2026 02:15
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jamesarich, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7965fec0-fa2b-4979-b293-304b963a9c2f

📥 Commits

Reviewing files that changed from the base of the PR and between 9cbb68d and e8f9b53.

📒 Files selected for processing (19)
  • .editorconfig
  • .github/workflows/ci.yml
  • CONTRIBUTING.md
  • build.gradle.kts
  • config/detekt/baseline.xml
  • config/detekt/detekt.yml
  • gradle/libs.versions.toml
  • src/commonMain/kotlin/org/meshtastic/kzstd/Zstd.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/ZstdDictionary.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/BitReader.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/Fse.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/Huffman.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/MatchIndex.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/OutputBuffer.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/ParsedDictionary.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/ZstdDecoder.kt
  • src/commonMain/kotlin/org/meshtastic/kzstd/internal/ZstdEncoder.kt
  • src/commonTest/kotlin/org/meshtastic/kzstd/TestVectors.kt
  • src/jvmTest/kotlin/org/meshtastic/kzstd/KzstdLibzstdInteropTest.kt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jamesarich
jamesarich added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit 6fdb710 Jul 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire spotless (ktlint) + detekt into the build

1 participant