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
Enable Scalafix and the OrganizeImports
rule
#981
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please fix merge conflicts?
case (2, _) => List(compilerPlugin(scalafixSemanticdb)) | ||
case _ => List.empty | ||
}.value, | ||
scalafixOnCompile := forScalaVersions { case (2, _) => true; case _ => false }.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit wary of having more and more build stuff conditionally disabled or modified for Scala 3.0... let's keep close track of these and remove them as soon as Scala 3.0 gets support for it.
build.sbt
Outdated
@@ -132,6 +142,7 @@ lazy val lintFlags = forScalaVersions { | |||
"-Xlint:_,-unused", | |||
"-Xfatal-warnings", | |||
"-Yno-adapted-args", | |||
"-Yrangepos", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you enable this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required for the SemanticDB compiler plugin (https://scalacenter.github.io/scalafix/docs/users/installation.html). I added a comment to make it explicit.
.github/workflows/ci.yml
Outdated
@@ -28,7 +28,8 @@ jobs: | |||
java-version: ${{ matrix.jdk }} | |||
|
|||
- name: Check formatting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name doesn't look accurate anymore. Maybe "Check formatting and run linter"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That seems like a better name.
Warning: the content of the PureConfig website changed with this pull request. This may be intentional (as is the case when sbt-microsites is updated or some breaking change occurs) or may be an unexpected change in the library's behavior. Please check the logs of the Diff Website job ("Build and compare website" step) in GitHub Actions to see the differences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Warning: the content of the PureConfig website changed with this pull request. This may be intentional (as is the case when sbt-microsites is updated or some breaking change occurs) or may be an unexpected change in the library's behavior. Please check the logs of the Diff Website job ("Build and compare website" step) in GitHub Actions to see the differences. |
This enables Scalafix and the
OrganizeImports
rule so that we can guarantee a consistent style for imports. I'm not sure if we had a style we were aiming for previously, but I opted to group imports into 4 groups: java imports, scala imports, non-pureconfig imports and pureconfig imports.