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

Gradle/Groovy importOrder no longer adds semicolons #291

Merged
merged 3 commits into from
Sep 2, 2018

Conversation

fvgh
Copy link
Member

@fvgh fvgh commented Aug 31, 2018

Gradle/Groovy importOrder no longer adds semicolons at end of statement.
Fixes #237 .

Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I think a small API change makes it easier to read.

Optional request: there's an easy-to-fix bug that fits well with this PR, wanna take a look? #218

}

public void importOrder(String... importOrder) {
addStep(ImportOrderStep.createFromOrder(importOrder));
addStep(importOrderStepFactory.createFrom(importOrder));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class GroovyExtension {
  public void importOrderFile(String... importOrder) {
    addStep(ImportOrderStep.noSemicolon().createFrom(importOrder));
  }

Instance fields are state, and less state is better than more state.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @nedtwigg , I would prefer to keep #218 out, since the purpose is different. Furthermore this PR has only effect on plugin-gradle (well, it should 😉 ), whereas #218 should be only documented in the CHANGES.md of spotless.

@nedtwigg nedtwigg merged commit a67fcf3 into master Sep 2, 2018
@nedtwigg nedtwigg deleted the import_sorter_semicolon branch September 2, 2018 01:33
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.

3 participants