Scala Coding Practices
Application skill for Scala style learning (from the archived awesome-guidelines style capsules). For Spark/Akka/ZIO stack patterns, load stack capsules under skills/*-foundation.
Core Principle
Scala readability is official layout/naming plus functional safety, immutable data, explicit public types, expression-oriented control, documented API.
When to Use / NOT
- Scala application/library source, Scalafmt/Scalafix/wartremover CI.
- Reviewing naming, types, case classes, control flow, Scaladoc.
NOT when:
- Non-Scala code.
- Generated boilerplate, validate generators instead.
- Spark-internal perf micro-optimizations, use the Databricks guide in stack capsules under
skills/*-foundation.
Workflow
- Format & layout, 2-space, wraps, control spacing (
scala-style-formatting-layout.md).
- Naming, packages, accessors, parentheses (
scala-style-naming-packages.md).
- Types, inference rules, immutability, Option (
scala-style-types-immutability.md).
- Control & docs, return, for, Scaladoc, errors (
scala-style-control-api.md).
- Verify, Scalafmt/Scalafix +
sbt test / sbt compile on changed modules.
Red Flags
- Tabs or 4-space indent
- Java getter/setter names in Scala API
- Side-effect nullary method without
()
- Symbolic operators in domain API
var in case class
- Missing
override
- Public method without return type
Option.get / null
return in closures
- Public API without Scaladoc
Verification
- Scalafmt/Scalafix on changed files
- Compile + tests for touched projects
- Capsule checklist on public API review
References
awesome-guidelines/references/scala-style-learning-note.md
awesome-guidelines/references/scala-style-formatting-layout.md
awesome-guidelines/references/scala-style-naming-packages.md
awesome-guidelines/references/scala-style-types-immutability.md
awesome-guidelines/references/scala-style-control-api.md
1---2name: scala-coding-practices3description: Use when authoring or reviewing Scala, 2-space layout, camelCase naming, accessor/mutator conventions, explicit public types, immutable case classes, Option over null, and Scaladoc on public API.4---56# Scala Coding Practices78Application skill for Scala style learning (from the archived `awesome-guidelines` style capsules). For Spark/Akka/ZIO stack patterns, load stack capsules under `skills/*-foundation`.910## Core Principle1112Scala readability is **official layout/naming plus functional safety**, immutable data, explicit public types, expression-oriented control, documented API.1314## When to Use / NOT1516- Scala application/library source, Scalafmt/Scalafix/wartremover CI.17- Reviewing naming, types, case classes, control flow, Scaladoc.1819**NOT when:**2021- Non-Scala code.22- Generated boilerplate, validate generators instead.23- Spark-internal perf micro-optimizations, use the Databricks guide in stack capsules under `skills/*-foundation`.2425## Workflow26271. **Format & layout**, 2-space, wraps, control spacing (`scala-style-formatting-layout.md`).282. **Naming**, packages, accessors, parentheses (`scala-style-naming-packages.md`).293. **Types**, inference rules, immutability, Option (`scala-style-types-immutability.md`).304. **Control & docs**, return, for, Scaladoc, errors (`scala-style-control-api.md`).315. **Verify**, Scalafmt/Scalafix + `sbt test` / `sbt compile` on changed modules.3233## Red Flags3435- Tabs or 4-space indent36- Java getter/setter names in Scala API37- Side-effect nullary method without `()`38- Symbolic operators in domain API39- `var` in case class40- Missing `override`41- Public method without return type42- `Option.get` / `null`43- `return` in closures44- Public API without Scaladoc4546## Verification4748- Scalafmt/Scalafix on changed files49- Compile + tests for touched projects50- Capsule checklist on public API review515253## References5455- `awesome-guidelines/references/scala-style-learning-note.md`56- `awesome-guidelines/references/scala-style-formatting-layout.md`57- `awesome-guidelines/references/scala-style-naming-packages.md`58- `awesome-guidelines/references/scala-style-types-immutability.md`59- `awesome-guidelines/references/scala-style-control-api.md`