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

Provide problem solution hint for structure warnings in stdout #1088

Merged
merged 2 commits into from
May 14, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class WriterResultPrinter(private val out: PrintWriter) : ResultPrinter {
appendLine("Plugin structure warnings (${pluginStructureWarnings.size}): ")
for (warning in pluginStructureWarnings) {
appendLine("$INDENT${warning.message}")
warning.problem.solutionHint.takeUnless { it.isBlank() }?.let { appendLine(INDENT + INDENT + it) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ package com.jetbrains.pluginverifier.warnings

import com.jetbrains.plugin.structure.base.problems.PluginProblem

data class PluginStructureWarning(private val pluginProblem: PluginProblem) {
data class PluginStructureWarning(val problem: PluginProblem) {

init {
check(pluginProblem.level == PluginProblem.Level.WARNING || pluginProblem.level == PluginProblem.Level.UNACCEPTABLE_WARNING)
check(problem.level == PluginProblem.Level.WARNING || problem.level == PluginProblem.Level.UNACCEPTABLE_WARNING)
}

val problemType: String get() = "Plugin descriptor warning"

val message: String get() = pluginProblem.message
val message: String get() = problem.message
}
Loading