Skip to content

Commit 9dde09b

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 9dde09b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

.scalafmt.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@ runner {
8181
allowAsForImportRename = false
8282
allowStarWildcardImport = false
8383
allowPostfixStarVarargSplices = false
84+
allowQuestionMarkPlaceholder = false
85+
allowMatchAsExpr = false
8486
}
8587
}

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+
- Scala 3 specific syntax (significant indentation, `as` import rename, `*` wildcard import, postfix `*` vararg splices, `?` placeholder, `match` as expression) must not be used. 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)