Skip to content

Commit 9ab5aa7

Browse files
committed
chore: disable additional Scala 3 specific syntax in scalafmt
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
1 parent 5623d10 commit 9ab5aa7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Before opening or updating a PR, verify:
66

77
- Non-doc-only changes have directional tests.
88
- Native `scalafmt` or the sbt scalafmt tasks were run for changed Scala/SBT files, or the missing tool is recorded in `Tests`.
9+
- 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`.
910
- `sbt javafmtAll` was run with JDK 17 when relevant.
1011
- `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.
1112
- For copied code, the source file or external project is noted in the PR (see Licensing Rules in `AGENTS.md`).

0 commit comments

Comments
 (0)