This is an automated email from the ASF dual-hosted git repository.
raboof pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new e044562d34 chore: disable additional Scala 3 specific syntax in
scalafmt (#3198)
e044562d34 is described below
commit e044562d34a7b23e3503749976fcc95ffcdccfdd
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sun Jul 19 07:51:22 2026 +0800
chore: disable additional Scala 3 specific syntax in scalafmt (#3198)
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
---
CLAUDE.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CLAUDE.md b/CLAUDE.md
index 76f25cef53..cde9cbe4c3 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -6,6 +6,7 @@ Before opening or updating a PR, verify:
- Non-doc-only changes have directional tests.
- Native `scalafmt` or the sbt scalafmt tasks were run for changed Scala/SBT
files, or the missing tool is recorded in `Tests`.
+- Code must use syntax compatible with both Scala 2.13 and Scala 3. Do not use
Scala 3-only syntax such as significant indentation, `as` for import rename,
`*` for wildcard import, or postfix `*` for vararg splices. The
`.scalafmt.conf` enforces these restrictions via `dialectOverride`.
- `sbt javafmtAll` was run with JDK 17 when relevant.
- `sbt headerCreateAll` was run to add headers for new files. Never hand-write
or invent license headers; let sbt manage them, and preserve existing copyright
notices intact.
- For copied code, the source file or external project is noted in the PR (see
Licensing Rules in `AGENTS.md`).
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]