From 9e527937c82a0cfda9bacc7ded426a21d723d49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=99=8E=E9=B8=A3?= Date: Sat, 27 Jun 2026 18:16:52 +0800 Subject: [PATCH] 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 - Add CLAUDE.md with Scala 3 syntax restrictions 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..c700425 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,12 @@ +# Claude Rules for Apache Pekko Samples + +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. +- Commit messages follow the standard format. +- `Tests` and `References` are present. +- No `Co-authored-by` or AI-assistant trailers are added to commits or PR descriptions.