Introduce CompilerMessageSeverity.STRONG_WARNING
This is a severity for mandatory warnings, i.e. those which should be reported in any case, even if there are compilation errors
This commit is contained in:
+27
-3
@@ -16,13 +16,16 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.messages;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public enum CompilerMessageSeverity {
|
||||
INFO,
|
||||
ERROR,
|
||||
WARNING,
|
||||
EXCEPTION,
|
||||
ERROR,
|
||||
STRONG_WARNING,
|
||||
WARNING,
|
||||
INFO,
|
||||
LOGGING,
|
||||
OUTPUT;
|
||||
|
||||
@@ -32,4 +35,25 @@ public enum CompilerMessageSeverity {
|
||||
public boolean isError() {
|
||||
return ERRORS.contains(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getPresentableName() {
|
||||
switch (this) {
|
||||
case EXCEPTION:
|
||||
return "exception";
|
||||
case ERROR:
|
||||
return "error";
|
||||
case STRONG_WARNING:
|
||||
case WARNING:
|
||||
return "warning";
|
||||
case INFO:
|
||||
return "info";
|
||||
case LOGGING:
|
||||
return "logging";
|
||||
case OUTPUT:
|
||||
return "output";
|
||||
default:
|
||||
throw new UnsupportedOperationException("Unknown severity: " + this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class GroupingMessageCollector implements MessageCollector {
|
||||
|
||||
for (String path : sortedKeys()) {
|
||||
for (Message message : groupedMessages.get(path)) {
|
||||
if (!hasErrors || message.severity.isError()) {
|
||||
if (!hasErrors || message.severity.isError() || message.severity == CompilerMessageSeverity.STRONG_WARNING) {
|
||||
delegate.report(message.severity, message.message, message.location);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user