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

"scala" block includes scalafix packages #6

Closed
etspaceman opened this issue Sep 9, 2019 · 6 comments
Closed

"scala" block includes scalafix packages #6

etspaceman opened this issue Sep 9, 2019 · 6 comments

Comments

@etspaceman
Copy link

etspaceman commented Sep 9, 2019

Hey there. Great plugin!

Was playing around with it today and noticed that, when applied to one of my SBT plugins (which sets some scalafix settings), the scalafix packages were considered as a part of the scala block.

import io.gatling.sbt.GatlingKeys._
import io.gatling.sbt.GatlingPlugin
import org.scalafmt.sbt.ScalafmtPlugin
import sbt.Keys._
import sbt._
import scalafix.sbt.ScalafixPlugin
import scalafix.sbt.ScalafixPlugin.autoImport._

Becomes

import scalafix.sbt.ScalafixPlugin
import scalafix.sbt.ScalafixPlugin.autoImport._

import io.gatling.sbt.GatlingKeys._
import io.gatling.sbt.GatlingPlugin
import org.scalafmt.sbt.ScalafmtPlugin
import sbt.Keys._
import sbt._

With a configuration like so:

SortImports.blocks = [
  "java",
  "scala",
  "*"
]
@pjrt
Copy link
Contributor

pjrt commented Sep 9, 2019

It also includes things like scalaz.

@mwz
Copy link

mwz commented Sep 9, 2019

Using the following config fixed this for me:

SortImports.blocks = [
  "java.",
  "scala.",
  "*"
]

@pjrt
Copy link
Contributor

pjrt commented Sep 9, 2019

Ah! Nice work around @mwz !

@pjrt
Copy link
Contributor

pjrt commented Sep 9, 2019

@NeQuissimus maybe update the README with @mwz 's proposal? More than likely that's what most ppl will want.

pjrt added a commit to pjrt/sort-imports that referenced this issue Sep 9, 2019
This will take care of issue NeQuissimus#6 without requiring code changes
@NeQuissimus
Copy link
Owner

Oh hey, thanks for checking this out! And we can definitely include that update.
Would that be sufficient, @etspaceman?

NeQuissimus pushed a commit that referenced this issue Sep 9, 2019
* Update README's config example

This will take care of issue #6 without requiring code changes

* Add the `.` to the `com.sun` part as well.
@etspaceman
Copy link
Author

Yeah that should be fine. Thanks!

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

No branches or pull requests

4 participants