Skip to content

Multi-line vs single-line method and class constructor declarations and invocations #58

Open
@jkbradley

Description

@jkbradley

Apache Spark (especially what I've seen of MLlib) and the current Scala style guide differ on one item: Should multiline method and class constructor invocations be written with 1 arg per line or multiple args per line?

Spark mostly uses multiple args per line (for invocation, not for declarations). The current Scala style guide says to put 1 arg per line: See "Methods with Numerous Arguments" here: http://docs.scala-lang.org/style/indentation.html

Can we add our standard to this doc?

E.g.:

  • For method and class definitions,
    • If they fit on 1 line, put everything on 1 line.
    • For multi-line definitions, put 1 argument per line.
  • For method and class constructor invocations,
    • If they fit on 1 line, put everything on 1 line.
    • For multi-line calls, put (multiple arguments per line) or (1 argument per line)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions