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

fix: enforce blank line after body declaration #398

Open
wants to merge 3 commits into
base: master
from

Conversation

@Shaolans
Copy link
Member

Shaolans commented Apr 28, 2020

What changed with this PR:

Fix #271

Example

// Input
public class JWTFilter extends GenericFilterBean {
    public static final String AUTHORIZATION_HEADER = "Authorization";

    private TokenProvider tokenProvider;
}
// Output
public class JWTFilter extends GenericFilterBean {

    public static final String AUTHORIZATION_HEADER = "Authorization";

    private TokenProvider tokenProvider;
}

However it should be noted that we can have this case:

// Input
public class MyClass {
    public void myMethod() {
        return new AnonymousClass() {
            int a;
        }
    }
}
// Output
public class MyClass {
    public void myMethod() {
        return new AnonymousClass() {

            int a;
        }
    }
}

Since inside the class this is also a classBodyDeclaration node.
I think we can probably make an exception on class body for anonymous class but I don't know if we should.

Relative issues or prs:

Shaolans added 3 commits Apr 28, 2020
fix
@pascalgrimaud
Copy link
Member

pascalgrimaud commented Sep 3, 2020

ping @Shaolans @clementdessoude
What's the state of this PR plz ?
It's opened since 4 months

@Shaolans
Copy link
Member Author

Shaolans commented Sep 5, 2020

It should be good to go but as I explained with this PR, when you now define an anonymous class it will enforce a blank line and I was wondering if we should keep it that way.

@pascalgrimaud
Copy link
Member

pascalgrimaud commented Sep 5, 2020

ok, you're right @Shaolans
exception for anonymous class should be nice. Is it possible ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.