Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spaces is allowed after keyword super #369

Closed
ww2lin opened this issue Apr 4, 2019 · 1 comment
Closed

spaces is allowed after keyword super #369

ww2lin opened this issue Apr 4, 2019 · 1 comment
Assignees
Labels

Comments

@ww2lin
Copy link

ww2lin commented Apr 4, 2019

Space after the super keyword is allowed, is this expected?

import android.content.Context
import android.util.AttributeSet
import android.view.ContextThemeWrapper
import androidx.appcompat.R.attr.buttonStyle
import androidx.appcompat.widget.AppCompatButton
import com.groupon.maui.components.R

class Test : AppCompatButton {

    @JvmOverloads
    constructor(context: Context, attributeSet: AttributeSet? = null, defStyleAttr: Int = buttonStyle) :
        super (ContextThemeWrapper(context, R.style.ghost_button), attributeSet, defStyleAttr) {
    }
}
@ww2lin ww2lin changed the title spaces is allowed after super() spaces is allowed after keyword super Apr 4, 2019
@shashachu
Copy link
Contributor

Looks like a bug to me. Style guide says A method or constructor name stays attached to the open parenthesis (() that follows it.

@shashachu shashachu self-assigned this Apr 9, 2019
shashachu added a commit to shashachu/ktlint that referenced this issue Apr 16, 2019
* When checking for unexpected spaces preceding a `(`, the rule was only checking elementType `IDENTIFIER`, so added a check for `SUPER_KEYWORD`
* Updated lint and formatting tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants