-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Respect Configuration in scalafixConfigSettings #154
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.
Thanks for the PR!
Which version were you upgrading from, and what started to fail? The inConfig(IntegrationTest)(scalafixConfigSettings(IntegrationTest))
syntax has been documented for a long time, see: https://github.com/scalacenter/scalafix/blame/6584af204fd2a5ef0c261fdc97ad599962a8ffa0/docs/users/installation.md#L138, so I am wondering what can have regressed in 0.9.19?
That's not to say we shouldn't try to simplify and get rid of the config repetition. However, using inConfig()
is pretty standard for all sbt plugins, the oddity here is that it's passed as an argument of scalafixConfigSettings
. I am AFK at the moment, but I think it is worth investigating whether we could remove that argument. As far as I remember, the scope passed in inConfig()
is only picked up within the settings block, not on value lookups in val
s or def
s that block references.
Hey @bjaglin,
0.9.17. I basically had the following code snippet:
This actually worked for a long time. Scalafix ran properly on my project's integration tests. I must have missed that item in the docs when going through my setup originally, and I was happily oblivious. 😅
Upgrading to 0.9.19 introduced the
Potentially! That is indeed the original source of my confusion here, because I assumed that passing in That said, I would also be happy with this implementation. I am biased of course. 😄 |
@@ -41,6 +40,8 @@ lazy val scala212 = project | |||
scalaVersion := Versions.scala212, | |||
scalafixSettings | |||
) | |||
.settings(scalafixConfigSettings(IntegrationTest): _*) |
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.
inConfig
seems to return the same type as scalafixConfigSettings
, is there a reason why you moved down all the settings and used the spread operator? it would be nicer if we could keep them inline (for the diff, but mostly for users!)
Hello -
Upgrading to sbt-scalafix 0.9.19 caused one of my projects to fail. When poking around, I noticed that the new
scalafixOnCompile
configuration setup did not respect the configuration that was passed into thescalafixConfigSettings
function.The scripted test got around this by doing
inConfig(IntegrationTest)(scalafixConfigSettings(IntegrationTest))
. You should be able to just doscalafixConfigSettings(IntegrationTest)
.This PR updates the
scalafixConfigSettings
function to respect the passedConfiguration
value for these items.