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

scaladoc should pick up warning flags #17022

Closed
wants to merge 1 commit into from

Conversation

mkurz
Copy link
Contributor

@mkurz mkurz commented Feb 27, 2023

Is there a reason why the warning flags do not get used for Scaladoc?

scalaVersion := "3.3.0-RC3"
Compile / scalacOptions := Seq("-Werror", "-Wconf:any:error")
> Compile / doc
...
[info] Skipping unused scalacOptions: -Werror, -Wconf
...

In Scala 2.13 these flags do get used when compiling scaladoc (At least -Werror does)

If you don't want to support all of the warning flags for scaladoc, would it be at least possible to support at least -Werror/-Xfatal-warnings? That would be easy too by just moving the val XfatalWarnings... from line 161 from the WarningTrait into the CommonScalaSettings trait.

This PR is somehow similar #13233 / #13061

@mkurz
Copy link
Contributor Author

mkurz commented Feb 27, 2023

Opened #17023 as well.

@mkurz
Copy link
Contributor Author

mkurz commented Mar 7, 2023

Would highly appreciate feedback here or for #17023, thanks!

@dwijnand
Copy link
Member

@som-snytt have you looked at the settings in Scala 3? Not sure how far they diverge from Scala 2. I think this PR looks ok to me.

@som-snytt
Copy link
Contributor

CommonSettings predates me. I would be hard-pressed to explain why Scaladoc options are not a strict superset of the compiler options. I mean strict in the loose sense that accords with the mathematical. Some options may not do anything, but I'd hope the tool doesn't complain, except under -Vdebug or something. (And I know I can supply -Vdebug without it complaining for the same reason.)

Otherwise, I think the trait organization of the options is just a convenience, so mix'n'match at will.

@som-snytt
Copy link
Contributor

Closing in favor of #17023, which is more narrow. Would lints or unused warnings apply to scaladoc? etc.

@som-snytt som-snytt closed this Dec 8, 2023
@mkurz mkurz deleted the apply_warning_flags_scala_docs branch December 11, 2023 20:53
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.

3 participants