scalacenter / scalafix

Refactoring and linting tool for Scala
https://scalacenter.github.io/scalafix/
BSD 3-Clause "New" or "Revised" License
831 stars 186 forks source link

DisableSyntax.regex reports error on // scalafix:ok regex #507

Open olafurpg opened 6 years ago

olafurpg commented 6 years ago

See https://github.com/scalacenter/scalafix/pull/500/files/9ae607183ec4721f6aefdd3cfc339535e347838e#diff-439023eeb6466236b27366980c2da737

If you disallow for example println, then it should be possible to escape that error with // scalafix:ok println. However, scalafix will report an error on "printlnin// scalafix:ok println`. It would be nice if scalafix handled this case by checking that the offensive location does not follow the string "scalafix:ok " or "scalafix:off ".

mlachkar commented 3 years ago

Not yet implemented. for the println example, to disable it, you need right now to do:

  println("Hello, World!") // scalafix:ok DisableSyntax
  println("Hello, World!") // scalafix:ok