question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn’t play well with `-Ywarn-unused-import`.

See original GitHub issue

We use -Ywarn-unused-import (and -Xfatal-warnings), and get

Unused import
import acyclic.file

on any file I add it to.

I don’t know of any way to silence an unused import warning (e.g., using @SuppressWarnings), but I’d happily do that if possible.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
lihaoyicommented, May 12, 2017

One solution would be to make the acyclic plugin remove that import when it sees it. If anyone wants to send a PR doing so, I’ll gladly merge it

1reaction
rintciuscommented, May 12, 2017

@sellout maybe this plugin can help? https://github.com/ghik/silencer (disclaimer: haven’t used it myself)

Read more comments on GitHub >

github_iconTop Results From Across the Web

scala - -Ywarn-unused-import triggering on play routes file
I just encountered the same problem with Scala 2.12 and Play 2.6 (which you're probably now using). A Scala compiler plugin called Silencer ......
Read more >
Can't use Scala 2.11 -Ywarn-unused-import because it trips ...
I'm trying to use the Scala 2.11 -Ywarn-unused-import option while compiling, but not in the console, where it effectively disables the ability ...
Read more >
RemoveUnused · Scalafix - Scala Center
Removes unused imports and terms that reported by the compiler under -Ywarn-unused.
Read more >
scalacenter/scalafix - Gitter
well, I'm working on some scalafix rule. it assumes replacing one deprecated ... -r RemoveUnused -f myproject/ --scalac-options "-Ywarn-unused-import, ...
Read more >
4.8. Warnings and sanity-checking - downloads for Haskell.org
Causes a warning to be emitted when a pragma that GHC doesn't recognise is used. As well ... Have the compiler warn if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found