Skip to content

Enforce scalafmt in CI#849

Merged
halotukozak merged 1 commit into
masterfrom
enforce-scalafmt-in-ci
May 27, 2026
Merged

Enforce scalafmt in CI#849
halotukozak merged 1 commit into
masterfrom
enforce-scalafmt-in-ci

Conversation

@ddworak
Copy link
Copy Markdown
Member

@ddworak ddworak commented May 26, 2026

Summary

  • Adds a dedicated scalafmt GitHub Actions job (parallel to build and mima) that runs scalafmtCheckAll + scalafmtSbtCheck on every PR. Modeled on the existing mima job — single JDK (temurin@21), single Scala version.
  • Two files change: a new WorkflowJob in project/Commons.scala and the regenerated .github/workflows/ci.yml.

Why now

Pattern check across our other repos: the DSLAM family (dhcp, dslam-ui, dslam-mc, yanush) all enforce scalafmt in CI; standalone Scala apps (ump, coiote-ae) carry .scalafmt.conf but no enforcement. scala-commons was the odd one out — it tracked the sbt plugin via steward without actually invoking it. With AI-assisted edits becoming more common, automated format enforcement earns its keep.

Test plan

Adds a dedicated GitHub Actions job that runs scalafmtCheckAll +
scalafmtSbtCheck on every PR, modeled on the existing mima job.
Without enforcement, formatter drift accumulates silently — increasingly
relevant as AI-assisted edits land in the repo.

Bundles supersedes of scala-steward PRs #845 (sbt-scalafmt 2.6.0 -> 2.6.1)
and #846 (scalafmt-core 3.11.0 -> 3.11.1), since the new check would
otherwise fail on master against the one file #846 reformats.
@ddworak ddworak force-pushed the enforce-scalafmt-in-ci branch from 1cd1705 to 219228b Compare May 26, 2026 12:07
@ddworak ddworak marked this pull request as ready for review May 27, 2026 08:05
@ddworak ddworak closed this May 27, 2026
@ddworak ddworak reopened this May 27, 2026
@ddworak ddworak requested a review from halotukozak May 27, 2026 08:16
@halotukozak halotukozak requested a review from Copilot May 27, 2026 11:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds scalafmt enforcement to CI by defining a dedicated sbt-github-actions job and committing the regenerated workflow.

Changes:

  • Adds a scalafmt workflow job in project/Commons.scala.
  • Regenerates .github/workflows/ci.yml with a parallel Scalafmt Check job running scalafmtCheckAll and scalafmtSbtCheck.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
project/Commons.scala Adds the generated CI job definition for scalafmt checks.
.github/workflows/ci.yml Regenerated workflow including the new scalafmt job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@halotukozak halotukozak merged commit 125a6c9 into master May 27, 2026
7 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.

3 participants