package hudson.plugins.warnings.parser;

import java.util.regex.Matcher;

import hudson.plugins.analysis.util.model.Priority;

import hudson.Extension;

/**
 * A parser for the PyLint compiler warnings.
 *
 * @author Sebastian Hansbauer
 */
@Extension
public class PyLintParser extends RegexpLineParser {
    private static final long serialVersionUID = 4464053085862883240L;

    private static final String PYLINT_ERROR_PATTERN = "(.*):(\\d+): \\[(\\D\\d*).*\\] (.*)";

    /**
     * Creates a new instance of {@link PyLintParser}.
     */
    public PyLintParser() {
        super(Messages._Warnings_PyLint_ParserName(),
                Messages._Warnings_PyLint_LinkName(),
                Messages._Warnings_PyLint_TrendName(),
                PYLINT_ERROR_PATTERN, true);
    }

    @Override
    protected boolean isLineInteresting(final String line) {
        return line.contains("[");
    }

    @Override
    protected Warning createWarning(final Matcher matcher) {
        String message = matcher.group(4);
        String category = classifyIfEmpty(matcher.group(3), message);
        //First letter of the Pylint classification is one of F/E/W/R/C. E/F/W are high priority.
        Priority priority = Priority.NORMAL;
        if (category[0] == 'E' || category[0] == 'F' || category[0] == 'W') {
            priority = Priority.HIGH;
        }
        
        return createWarning(matcher.group(1), getLineNumber(matcher.group(2)), category, message, priority);
    }
}

@@ -1243,27 +1243,34 @@
 if (category
-%5B0%5D
+.charAt(0)
  == 'E' %7C%7C c
@@ -1272,27 +1272,34 @@
  %7C%7C category
-%5B0%5D
+.charAt(0)
  == 'F' %7C%7C c
@@ -1309,11 +1309,18 @@
 gory
-%5B0%5D
+.charAt(0)
  == 

Update PyLintParser.java