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

Provide a test to replicate issue #102 #103

Closed
wants to merge 2 commits into from

Conversation

DavidGregory084
Copy link
Member

This is a test to replicate #102 thanks to @keynmol's great example on the ticket

@DavidGregory084

This comment was marked as resolved.

@DavidGregory084
Copy link
Member Author

I've realised now that this -scalajs option is for Scala 3.x only

@@ -22,14 +22,20 @@ Test / tpolecatOptionsMode := DevMode

TaskKey[Unit]("checkCompileOptions") := {
val hasFatalWarnings =
scalacOptions.value.contains("-Xfatal-warnings")
(Compile / scalacOptions).value.contains("-Xfatal-warnings")
Copy link
Member Author

Choose a reason for hiding this comment

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

Unscoped settings no longer receive the changes applied by this plugin if we are using configuration filters

@DavidGregory084
Copy link
Member Author

The latest commit attempts to resolve the problem by dropping derived settings and switching to configuration filters.

The immediate problem with this was that manipulating unscoped settings no longer worked, e.g. the following manipulation no longer contributed to Compile/tpolecatReleaseModeOptions:

tpolecatReleaseModeOptions ++= {
  ScalacOptions.optimizerOptions("**") +
    ScalacOptions.release("8") +
    ScalacOptions.privateBackendParallelism(8)
}

This prompted me to try appending to tpolecatReleaseModeOptions in the sbtTpolecatSettings, which unfortunately breaks the ordering of options that we got from using ListSet within the plugin:

    tpolecatDevModeOptions ++= ScalacOptions.default,
    tpolecatCiModeOptions ++= tpolecatDevModeOptions.value + ScalacOptions.fatalWarnings,
    tpolecatReleaseModeOptions ++= tpolecatCiModeOptions.value + ScalacOptions.optimizerMethodLocal,

I'm afraid it did not resolve the problem in any case as we still see settings duplication in the modePerConfiguration test in Test/scalacOptions regardless of whether ++= is used in the tpolecat*Options.

@DavidGregory084
Copy link
Member Author

No longer needed due to #126

@TonioGela TonioGela deleted the preserve-scala-js-option branch August 27, 2024 20:05
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.

1 participant