https://pantsbuild.org/ logo
#general
Title
# general
b

brief-engineer-67497

01/31/2019, 3:06 PM
hi, I'm having some trouble to use scalafix with pants. I run
./pants fmt.scalafix --semantic --rules=RemoveUnused libs/common/src/main/scala
and I got the following message :
Copy code
==== stderr ====

                     ==== stdout ====
                     error: The Scala compiler option "-Ywarn-unused" is required to use RemoveUnused.
                     To fix this problem, update your build to use at least one Scala compiler
                     option that starts with "-Ywarn-unused"
                     DEBUG] releasing lock: <pants.process.lock.OwnerPrintingInterProcessFileLock object at 0x7f65e8085410>                                                                                                                   

FAILURE: scalafix.cli.Cli ... failed to fix (4) targets.
yet I have these lines in my pants.ini
Copy code
[compile.zinc]
args: [
      # ...
      '-S-Ywarn-unused:implicits',
      '-S-Ywarn-unused:imports',
      '-S-Ywarn-unused:locals',
      '-S-Ywarn-unused:params',
      '-S-Ywarn-unused:patvars',
      '-S-Ywarn-unused:privates',
      '-S-Ywarn-value-discard',
      '-S-Yrangepos'
  ]
And the
ldebug
does show me these args
w

wide-energy-11069

01/31/2019, 7:13 PM
possibly scalac is expecting
-Ywarn-unused
as an option instead of the finer grained ones?
b

brief-engineer-67497

01/31/2019, 10:01 PM
yet the message says
that starts with "-Ywarn-unused"
, but good point, I'll try it tomorrow, thx
w

witty-crayon-22786

01/31/2019, 10:47 PM
b

brief-engineer-67497

02/01/2019, 9:48 AM
sorry it does not help, and using the vanilla
-Ywarn-unused
does not do the trick either 😕
5 Views