Skip to content

ci: add fast syntactic-only scalafix gate#4581

Open
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:ci-fast-syntactic-scalafix
Open

ci: add fast syntactic-only scalafix gate#4581
andygrove wants to merge 1 commit into
apache:mainfrom
andygrove:ci-fast-syntactic-scalafix

Conversation

@andygrove
Copy link
Copy Markdown
Member

@andygrove andygrove commented Jun 3, 2026

Which issue does this PR close?

Closes #4545

Rationale for this change

.scalafix.conf mixes two kinds of rules: semantic rules (ExplicitResultTypes, NoAutoTupling, RemoveUnused) that require a full compile, and syntactic rules (DisableSyntax, LeakingImplicitClassVal, NoValInForComprehension, ProcedureSyntax, RedundantSyntax) that only parse source.

The lint-java job runs the whole set behind ./mvnw package -Psemanticdb as a 4-way Spark matrix, so a trivial syntactic issue (for example the redundant s string interpolator that broke #4579) only surfaces after roughly 3.5 minutes of building, repeated across four matrix legs.

The syntactic rules need no compilation and are independent of the Spark/Scala profile, so they can be checked once, in seconds.

A second benefit: lint-java deliberately skips Spark 4.1 / 4.2 (semanticdb-scalac for those Scala patch versions is not published, so it cannot run -Psemanticdb). The new check scans every Scala source, so it is the only gate covering the spark-4.1 / spark-4.2 trees. It immediately surfaced one pre-existing RedundantSyntax violation in CometDecimalArithmeticViewSuite (a spark-4.1 test), which is fixed here.

What changes are included in this PR?

  • New .scalafix-syntactic.conf containing the syntactic-only rule subset. .scalafix.conf is unchanged and still enforces the full set in lint-java.
  • New scalafix-syntactic job in pr_build_linux.yml that runs the scalafix CLI (--check --syntactic) via coursier with no compile, no Maven, and no Spark matrix. It runs as a peer of the existing fast lint job and does not gate or reorder the semantic matrix.
  • Fix the one pre-existing redundant s interpolator in CometDecimalArithmeticViewSuite so the new job passes on a clean tree.

How are these changes tested?

Validated locally with the scalafix CLI against the full spark/ source tree:

The lint-java job only catches scalafix violations after a full
compile (needed for the semantic rules) and runs as a 4-way Spark
matrix, so a trivial syntactic issue such as a redundant string
interpolator surfaces only after roughly 3.5 minutes of building.

Add a standalone scalafix-syntactic job that runs the syntactic-only
rule subset via the scalafix CLI with no compilation, giving feedback
in seconds. Because syntactic rules are profile-independent, it scans
every Scala source once, including the spark-4.1 and spark-4.2 trees
that lint-java skips (those profiles cannot run -Psemanticdb yet), so
it is the only gate covering them.

Fix the one pre-existing RedundantSyntax violation this surfaces, a
redundant s interpolator in CometDecimalArithmeticViewSuite, so the
new job passes on a clean tree.
Copy link
Copy Markdown
Contributor

@mbutrovich mbutrovich left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks @andygrove!

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.

CI lint check passed, but then later jobs failed with lint errors

2 participants