Skip to content

scaladoc should take -Werror/-Xfatal-warnings into account #17023

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkurz
Copy link
Contributor

@mkurz mkurz commented Feb 27, 2023

Alternative to #17022

@som-snytt
Copy link
Contributor

Scaladoc settings already uses AllScalaSettings. I must be missing something. That's what I intended on the other PR.

https://github.com/lampepfl/dotty/blob/main/scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala#L6

@som-snytt
Copy link
Contributor

The relevant filtering is at https://github.com/lampepfl/dotty/blame/main/scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala#L123

where only common settings are retained.

I tried it out locally. I see the use case is that Scaladoc tool emits warnings.

$ ~/projects/dotty/bin/scaladoc -d /tmp/sandbox -Werror S.tasty
-- Error: s.scala:7:6 --------------------------------------------------------------------------------------------------
7 |class S {
  |      ^
  |      No DRI found for query: some

-Wconf could also be relocated to common. I'll try it out, too, albeit I put them after silentWarnings.

Incremental compilation breaks with this edit, alas.

Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and could even move Wconf.

Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must rerun CI anyway, and add Wconf definitely.

Probably there is a command here to rerun CI.

@som-snytt
Copy link
Contributor

som-snytt commented Dec 8, 2023

scaladoc/build says

Problem parsing scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala:[0..29..29489], documentation may not be generated.
Problem parsing scaladoc/src/dotty/tools/scaladoc/tasty/InkuireSupport.scala:[0..29..16233], documentation may not be generated.
Problem parsing scaladoc/src/dotty/tools/scaladoc/tasty/PackageSupport.scala:[0..20..517], documentation may not be generated.
Error:  -- Error: scaladoc/src/dotty/tools/scaladoc/tasty/comments/wiki/Entities.scala:10:17 
Error:  10 |final case class Body(blocks: Seq[Block]) {
Error:     |                 ^
Error:     |       No DRI found for query: scala.tools.nsc.doc.model.comment.Summary
Error:  -- Error: docs/_docs/index.md --------------------------------------------------
Error:  /home/runner/work/dotty/dotty/./docs/_docs/index.md: Unable to resolve link 'docs/reference/index.html'
Error:  -- Error: docs/_docs/reference/overview.md -------------------------------------
Error:  /home/runner/work/dotty/dotty/./docs/_docs/reference/overview.md: Unable to resolve link 'new-types/intersection-types.md'
Error:  -- Error: docs/_docs/reference/overview.md -------------------------------------
Error:  /home/runner/work/dotty/dotty/./docs/_docs/reference/overview.md: Unable to resolve link 'new-types/union-types.md'
Error:  -- Error: docs/_docs/reference/overview.md -------------------------------------

I'll attempt to follow up. Possibly not this evening.

@dabrowski-adam
Copy link
Contributor

dabrowski-adam commented Aug 9, 2024

This would be very helpful to work around #20028. In a project that I work on, we had to disable treating warnings as errors because No DRI found for query: Enum caused sbt publishLocal to fail.

@KacperFKorban
Copy link
Member

@dabrowski-adam I think that there is a specific scaladoc setting for disabling these warnings - -no-link-warnings.

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.

4 participants