Skip to content

Scalastyle proposed rules (Types)

Matthew Farwell edited this page Nov 16, 2011 · 3 revisions

This page contains proposed rules for Scalastyle, for the category Types

Types

publicMethodsDeclaredTypes

Checks any publicly accessible methods have the type explicitly declared. This passes: def method(): Int = 1 This fails def method() = 1 Rationale: This helps with understanding a method

Type Annotation

Checks that types are annotated with the colon in the correct place This passes: def method(): Int = 1 This fails def method() : Int = 1 Rationale: This is standard behaviour in the scala library, and avoids confusion in certain circumstances.