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

Fix: -no-link-warnings does not work #17028

Merged
merged 2 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions project/ScaladocGeneration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ object ScaladocGeneration {
def key: String = "-no-link-warnings"
}

case class NoLinkAssetWarnings(value: Boolean) extends Arg[Boolean] {
def key: String = "-no-link-asset-warnings"
}

case class VersionsDictionaryUrl(value: String) extends Arg[String] {
def key: String = "-versions-dictionary-url"
}
Expand Down
2 changes: 2 additions & 0 deletions scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ object Scaladoc:
documentSyntheticTypes: Boolean = false,
snippetCompiler: List[String] = Nil,
noLinkWarnings: Boolean = false,
noLinkAssetWarnings: Boolean = false,
versionsDictionaryUrl: Option[String] = None,
generateInkuire : Boolean = false,
apiSubdirectory : Boolean = false,
Expand Down Expand Up @@ -221,6 +222,7 @@ object Scaladoc:
YdocumentSyntheticTypes.get,
snippetCompiler.get,
noLinkWarnings.get,
noLinkAssetWarnings.get,
versionsDictionaryUrl.nonDefault,
generateInkuire.get,
apiSubdirectory.get,
Expand Down
6 changes: 6 additions & 0 deletions scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
false
)

val noLinkAssetWarnings: Setting[Boolean] = BooleanSetting(
"-no-link-asset-warnings",
"Avoid warnings for incorrect links of assets like images, static pages, etc.",
false
)

val versionsDictionaryUrl: Setting[String] = StringSetting(
"-versions-dictionary-url",
"versions dictionary url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ trait SiteRenderer(using DocContext) extends Locations:
.orElse(asStaticSite)
.orElse(asAsset)
.getOrElse {
report.warn(s"Unable to resolve link '$str'", content.template.templateFile.file)
if (!summon[DocContext].args.noLinkAssetWarnings){
val msg = s"Unable to resolve link '$str'"
report.warn(msg, content.template.templateFile.file)
}
str
}

Expand Down