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

support running scalafix on projects with sources at the root #181

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Dec 1, 2020

When defining local rules using the Scalafix configuration, libraryDependencies must be defined, as documented in: https://scalacenter.github.io/scalafix/docs/developers/local-rules.html. We could add it by default, but it would unnecessarily clutter the update task in 99.9% of the plugin use cases.

When projects have a custom directory layout (via scalaSource), users could not know that Scalafix settings would need to be updated to exclude sources potentially at the root (sourcesInBase), in order to prevent compilation errors as Scalafix does not have the Scala libs, causing:

scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found.

This commit disables sourcesInBase by default to prevent this, as the local rules have no reason to share code with other default configurations anyway.

@bjaglin
Copy link
Collaborator Author

bjaglin commented Dec 1, 2020

When defining local rules using the Scalafix configuration,
libraryDependencies must be defined, as documented in:
https://scalacenter.github.io/scalafix/docs/developers/local-rules.html.
We could add it by default, but it would unnecessarily clutter the
update task in 99.9% of the plugin use cases.

When projects have a custom directory layout (via scalaSource), users
could not know that Scalafix settings would need to be updated to exclude
sources potentially at the root (sourcesInBase), in order to prevent
compilation errors as Scalafix does not have the Scala libs, causing:

> scala.reflect.internal.MissingRequirementError: object scala in
> compiler mirror not found.

This commit disables sourcesInBase by default to prevent this, as the
local rules have no reason to share code with other default
configurations anyway.
@bjaglin bjaglin marked this pull request as ready for review December 2, 2020 08:22
@bjaglin bjaglin requested a review from olafurpg December 2, 2020 08:23
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

I'm not sure I fully understand the details of this issue but the change looks good to me 👍 I only use the src/{main,test}/scala convention in my projects

@bjaglin bjaglin merged commit 1d4f1b5 into scalacenter:master Dec 4, 2020
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