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

File needs to be formatted twice #290

Closed
jhaber opened this issue Nov 15, 2019 · 4 comments · Fixed by #294
Closed

File needs to be formatted twice #290

jhaber opened this issue Nov 15, 2019 · 4 comments · Fixed by #294
Labels
area: bug 🐛 Something isn't working good first issue Good for newcomers status: PR done The PR to fix this issue is done theme: Re-Writer

Comments

@jhaber
Copy link
Contributor

jhaber commented Nov 15, 2019

Ran into an issue where a file needs to be formatted twice to pass --check. Formatter args were --print-width 90. I simplified the code to remove everything extraneous.

Original:

package com.example;

import java.util.Objects;

public class Example {
  private final String service = "abc";
  private final String instance = "123";

  public boolean equals(Example that) {
    return Objects.equals(service, that.service) &&
        Objects.equals(instance, that.instance);
  }
}

Formatted once (still fails --check):

package com.example;

import java.util.Objects;

public class Example {
  private final String service = "abc";
  private final String instance = "123";

  public boolean equals(Example that) {
    return (
      Objects.equals(service, that.service) &&
      Objects.equals(instance, that.instance)
    );
  }
}

Formatted twice (passes --check):

package com.example;

import java.util.Objects;

public class Example {
  private final String service = "abc";
  private final String instance = "123";

  public boolean equals(Example that) {
    return (
      Objects.equals(service, that.service) && Objects.equals(instance, that.instance)
    );
  }
}
@clementdessoude clementdessoude added area: bug 🐛 Something isn't working theme: Re-Writer good first issue Good for newcomers labels Nov 15, 2019
@clementdessoude clementdessoude added the status: PR done The PR to fix this issue is done label Nov 18, 2019
@pascalgrimaud pascalgrimaud added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/ labels Nov 18, 2019
@pascalgrimaud
Copy link
Member

pascalgrimaud commented Nov 18, 2019

Adding a bounty on this

@clementdessoude clementdessoude removed $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/ labels Nov 18, 2019
@clementdessoude
Copy link
Contributor

No need for this one, it was a breeze to fix :)

@pascalgrimaud pascalgrimaud added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/ labels Nov 18, 2019
@pascalgrimaud
Copy link
Member

Ok @clement26695, just tell me where I can reassign this 100$

@pascalgrimaud pascalgrimaud removed $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/ labels Nov 18, 2019
@jhaber
Copy link
Contributor Author

jhaber commented Nov 18, 2019

Thanks so much for the quick fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bug 🐛 Something isn't working good first issue Good for newcomers status: PR done The PR to fix this issue is done theme: Re-Writer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants