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

Merged
merged 5 commits into from
Oct 6, 2020

Conversation

Shaolans
Copy link
Member

@Shaolans 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:

@pascalgrimaud
Copy link
Member

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

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

@sanjayrawat1
Copy link

@Shaolans Is there any update on this PR, please. I would like to adopt prettier-java in my new project but because of this issue, I would not be able.

@Shaolans
Copy link
Member Author

Hi,
Sorry I was quite busy these past few weeks.
I will try to do it this week or the next one.

@Shaolans Shaolans force-pushed the fix-271 branch 2 times, most recently from d7b7e8b to 2e35efe Compare September 28, 2020 20:58
@Shaolans
Copy link
Member Author

It should be good to go.
@clementdessoude Can you merge and make a release since this bug was requested many times ?

@sanjayrawat1
Copy link

If @clementdessoude is not available can someone else merge this PR, please! Maybe @pascalgrimaud or @deepu105.

@pascalgrimaud
Copy link
Member

I'll contact Clement today

@pascalgrimaud pascalgrimaud merged commit 00908c6 into jhipster:master Oct 6, 2020
@sanjayrawat1
Copy link

Thanks, @pascalgrimaud for merging this PR. I guess the team is waiting for other PRs (#384) to get merged, after that the new release will come out. Hoping for the new release coming out soon.

@pascalgrimaud
Copy link
Member

@sanjayrawat1 : I don't forget you. I didn't manage to contact @clementdessoude about release process.
I'm waiting @Shaolans or @Hawkurane to merge this #384
If no answer, I'll trust you and merge it myself. Then, I'll try to do a new release.

@pascalgrimaud
Copy link
Member

Just have some news about Clément. He told me he'll try to find time for reviewing the other PR and will do a new release during this week-end.
Is it fine for you @sanjayrawat1 ?

@sanjayrawat1
Copy link

sanjayrawat1 commented Oct 8, 2020

@pascalgrimaud Yeah, it's fine. Thanks a lot!

@sanjayrawat1
Copy link

@pascalgrimaud can we have a release, please?

@pascalgrimaud
Copy link
Member

@sanjayrawat1 : I'll try

@pascalgrimaud
Copy link
Member

@sanjayrawat1 : just release v0.8.3 -> https://github.com/jhipster/prettier-java/releases/tag/v0.8.3
I'm waiting your feedbacks to tell me if it works well, like you wish

@sanjayrawat1
Copy link

@pascalgrimaud Yeah, it's working as expected. Thanks :)

@clementdessoude
Copy link
Contributor

Thank you for taking care of the release @pascalgrimaud !

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

Successfully merging this pull request may close these issues.

Blank line removed after class declaration
4 participants