Skip to content

Conversation

@Friendseeker
Copy link
Member

@Friendseeker Friendseeker commented Oct 18, 2024

Let CI emit warning for unused import, unused variable etc.

@Friendseeker Friendseeker changed the title [2.x] Tell Scala Compiler to emit warning for unused [2.x] Emit warning for unused import Oct 18, 2024
@Friendseeker
Copy link
Member Author

Friendseeker commented Oct 18, 2024

Actually this is a good change to have in 1.10.x branch. Maybe do it in 1.10.x first and then forward merge?

In 1.10.x we have -Xfatal-warnings on for Scala 2.12 build so may need to do some grunt work.


Now I see why "-Ywarn-unused" was not enabled first... It sometimes have false positive

[error] D:\Repos\zinc\internal\zinc-classpath\src\main\scala\sbt\internal\inc\ReflectUtilities.scala:52:11: parameter value field in anonymous function is never used
[error]           field <- correspondingFields.get(method.getName)

I guess I shall take a break from linting for now. Having two branches & cross building against multiple Scala versions complicate things, and unused is far less important than deprecation warnings.

If anyone else is interested, feel free to takeover the PR.

@Friendseeker Friendseeker changed the title [2.x] Emit warning for unused import [2.x] Emit warning for unused Oct 19, 2024
@SethTisue
Copy link
Member

Yeah, unused warnings in 2.12 aren't that great. A ton of work (mainly by @som-snytt) went into them later.

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.

2 participants