Skip to content

chore: document Scala 2.13/3 syntax compatibility requirements in CLAUDE.md#3198

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:scalafmt-disable-scala3-syntax
Open

chore: document Scala 2.13/3 syntax compatibility requirements in CLAUDE.md#3198
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:scalafmt-disable-scala3-syntax

Conversation

@He-Pin

@He-Pin He-Pin commented Jun 27, 2026

Copy link
Copy Markdown
Member

Motivation

Document the Scala 2.13 and Scala 3 syntax compatibility requirements in CLAUDE.md to ensure consistent code style.

Modification

  • Add CLAUDE.md rule: code must use syntax compatible with both Scala 2.13 and Scala 3
  • Do not use Scala 3-only syntax: significant indentation, as for import rename, * for wildcard import, postfix * for vararg splices
  • The .scalafmt.conf dialectOverride already enforces these restrictions

Result

CLAUDE.md now explicitly documents the Scala 2.13/3 syntax compatibility requirement, matching the existing .scalafmt.conf configuration.

Tests

Not run - documentation only

References

None - code style configuration

Motivation:
Ensure consistent code style across the codebase by explicitly disabling
Scala 3 specific syntax features that could lead to inconsistent formatting.

Modification:
- Add allowQuestionMarkPlaceholder = false to dialectOverride
- Add allowMatchAsExpr = false to dialectOverride
- Document Scala 3 syntax restrictions in CLAUDE.md

Result:
scalafmt now enforces restrictions on Scala 3 specific syntax including
significant indentation, as import rename, * wildcard import, postfix *
vararg splices, ? placeholder, and match as expression.

Tests:
Not run - configuration only

References:
None - code style configuration
@He-Pin He-Pin force-pushed the scalafmt-disable-scala3-syntax branch from 98eb231 to 7c0b29f Compare June 27, 2026 10:37
@He-Pin He-Pin changed the title chore: disable additional Scala 3 specific syntax in scalafmt chore: document Scala 2.13/3 syntax compatibility requirements in CLAUDE.md Jun 27, 2026
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.

1 participant