Skip to content

Commit

Permalink
Clarification for enums (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk authored and rxin committed Nov 13, 2019
1 parent 7eb5477 commit 6ad8b79
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,23 @@ We mostly follow Java's and Scala's standard naming conventions.
}
```

- Enums should be PascalCase.
- An enumeration class or object which extends the `Enumeration` class shall follow the convention for classes and objects, i.e. its name should be in PascalCase style. Enumeration values shall be in the upper case with words separated by the underscore character `_`. For example:
```scala
private object ParseState extends Enumeration {
type ParseState = Value

val PREFIX,
TRIM_BEFORE_SIGN,
SIGN,
TRIM_BEFORE_VALUE,
VALUE,
VALUE_FRACTIONAL_PART,
TRIM_BEFORE_UNIT,
UNIT_BEGIN,
UNIT_SUFFIX,
UNIT_END = Value
}
```

- Annotations should also follow Java convention, i.e. PascalCase. Note that this differs from Scala's official guide.
```scala
Expand Down

0 comments on commit 6ad8b79

Please sign in to comment.