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

Enable Scalafix and the OrganizeImports rule #981

Merged
merged 9 commits into from Apr 4, 2021

Conversation

jcazevedo
Copy link
Member

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.

Copy link
Member

@ruippeixotog ruippeixotog left a 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?

.scalafix.conf Show resolved Hide resolved
case (2, _) => List(compilerPlugin(scalafixSemanticdb))
case _ => List.empty
}.value,
scalafixOnCompile := forScalaVersions { case (2, _) => true; case _ => false }.value,
Copy link
Member

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",
Copy link
Member

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?

Copy link
Member Author

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.

@@ -28,7 +28,8 @@ jobs:
java-version: ${{ matrix.jdk }}

- name: Check formatting
Copy link
Member

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"?

Copy link
Member Author

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.

@github-actions
Copy link

github-actions bot commented Apr 3, 2021

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.

@pureconfig pureconfig deleted a comment from github-actions bot Apr 3, 2021
@pureconfig pureconfig deleted a comment from github-actions bot Apr 3, 2021
@pureconfig pureconfig deleted a comment from github-actions bot Apr 3, 2021
@pureconfig pureconfig deleted a comment from github-actions bot Apr 3, 2021
Copy link
Member

@ruippeixotog ruippeixotog left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions
Copy link

github-actions bot commented Apr 3, 2021

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.

@ruippeixotog ruippeixotog merged commit d2d1447 into master Apr 4, 2021
@ruippeixotog ruippeixotog deleted the scalafix-organize-imports branch April 4, 2021 23:16
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.

None yet

2 participants