pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.06k stars 504 forks source link

Fix unwanted whitespace between super class constructor and its argument list #2630

Closed tKe closed 2 months ago

tKe commented 2 months ago

Description

Adds support for detecting whitespace before a value argument list when it follows the type argument list of a constructor call.

This is needed to correctly detect and remove the excess whitespace in the following sample:

class MyClass : MySuper<String> ("hello")

Checklist

Before submitting the PR, please check following (checks which are not relevant may be ignored):

Documentation is updated. See difference between snapshot and release documentation

paul-dingemans commented 2 months ago

Tnx for your contribution. I have added similar logic to the class-signature rule which in the long run might replace (parts of) the paren-spacing rule.