scala-ide / scalariform

Scala source code formatter
http://scala-ide.github.com/scalariform/
MIT License
527 stars 148 forks source link

NoWhitespaceBeforeLeftBracketChecker on multiple lines #285

Open vegarsti opened 5 years ago

vegarsti commented 5 years ago

We are using Scalastyle along with Scalafmt. In our codebase, we have at least one instance of this:

    private def someFunctionName(
        argument: ADT[
            OneDataType,
            AnotherDataType,
            AThirdDataType,

In the case of a long function declaration like this, Scalastyle, using Scalariform, complains about rule NoWhitespaceBeforeLeftBracketChecker being broken, since there is a space after ADT. However, the arguments to ADT are so long that Scalafmt breaks it into multiple lines. Thus, Scalastyle complains.

Is there a good fix for this? One way is to disable this specific rule, but when it doesn't apply to multiple lines, it's a good rule. Another fix is of course to create a class for this argument such that it fits in one line.