Dmitry Jemerov

Results 19 issues of Dmitry Jemerov

The current guide says: "When a line is broken at a non-assignment operator the break comes before the symbol". Unfortunately this breaks semantics for +/- operators, which can be used...

The style guide doesn't talk about naming enum constants. They don't fall under "Constant values can only be defined inside of an object or as a top-level declaration", so they...

proposal
page/style

When wrapping chained calls, put the . character or the `?.` operator on the next line, with a single indent: ``` val anchor = owner.firstChild!! .siblings(forward = true) .dropWhile {...

Prefer using the expression form of `try`, `if` and `when`. Example: ``` return if (x) foo() else bar() ``` The above is preferable to: ``` if (x) return foo() else...

When possible, put lambdas on a single line, using `it` for single-parameter lambdas: ``` elements.dropWhile { it !is KDoc } ``` Don't use `it` in nested lambdas; always declare parameter...

Generally, the contents of a class is sorted in the following order: - Property declarations - Initializer blocks - Method declarations - Companion object Do not sort the method declarations...

If you declare a factory function for a class, don't give it the same name as the class itself. Use a distinct name making it clear why the behavior of...

Use top-level objects only if the instances of those objects will be passed somewhere (in other words, if the objects extend a base class or implement an interface). Do not...

If the class header (primary constructor and superclass list) doesn't fit on a single line, put the opening curly brace of the class on a separate line, with no indentation....