mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-27940 Try to parse pycodestyle.py errors even if stderr is not empty
They haven't updated the script for the recent changes of re module in Python 3.7, and, otherwise, FutureWarnings in its output prevent us from displaying any messages from the linter at all.
This commit is contained in:
@@ -50,6 +50,7 @@ import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
|
||||
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.jetbrains.python.PyTokenTypes;
|
||||
import com.jetbrains.python.PythonFileType;
|
||||
import com.jetbrains.python.PythonHelper;
|
||||
@@ -234,18 +235,14 @@ public class Pep8ExternalAnnotator extends ExternalAnnotator<Pep8ExternalAnnotat
|
||||
Results results = new Results(collectedInfo.level);
|
||||
if (output.isTimeout()) {
|
||||
LOG.info("Timeout running pycodestyle.py");
|
||||
return results;
|
||||
}
|
||||
else if (output.getStderrLines().isEmpty()) {
|
||||
for (String line : output.getStdoutLines()) {
|
||||
final Problem problem = parseProblem(line);
|
||||
if (problem != null) {
|
||||
results.problems.add(problem);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (((ApplicationInfoImpl) ApplicationInfo.getInstance()).isEAP()) {
|
||||
if (!output.getStderr().isEmpty() && ((ApplicationInfoImpl) ApplicationInfo.getInstance()).isEAP()) {
|
||||
LOG.info("Error running pycodestyle.py: " + output.getStderr());
|
||||
}
|
||||
for (String line : output.getStdoutLines()) {
|
||||
ContainerUtil.addIfNotNull(results.problems, parseProblem(line));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user