Skip to content

Gradle/Groovy importOrder no longer adds semicolons - #291

Merged
nedtwigg merged 3 commits into
masterfrom
import_sorter_semicolon
Sep 2, 2018
Merged

nedtwigg merged 3 commits into
masterfrom
import_sorter_semicolon

Conversation

@fvgh

@fvgh fvgh commented Aug 31, 2018

Copy link
Copy Markdown
Member

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

@nedtwigg nedtwigg left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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