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

pep8 parser to log high severity fatal errors #59

Open
oppianmatt opened this issue Mar 30, 2015 · 0 comments
Open

pep8 parser to log high severity fatal errors #59

oppianmatt opened this issue Mar 30, 2015 · 0 comments

Comments

@oppianmatt
Copy link

Looking at the source of pep8 parser, seems to be only able to set med or low in severity.

    /**
     * Returns the Severity level as an int from the PEP 8 message type.
     *
     * The different message types are W for warning and E for error.
     * Because these are style guide warnings we set the severity
     * values lower than what the apparent values would be.
     *
     * @param messageType the type of PEP 8 message
     * @return an int is matched to the message type.
     */
    private void setServerityLevel(Violation violation, String messageType) {

        switch (messageType.charAt(0)) {
            case 'E':
                violation.setSeverity(Severity.MEDIUM);
                violation.setSeverityLevel(Severity.MEDIUM_VALUE);
                break;
            case 'W':
            default:
                violation.setSeverity(Severity.LOW);
                violation.setSeverityLevel(Severity.LOW_VALUE);
                break;
        }
    }

Would it be possible to add HIGH level for FATAL errors like:

foo/bar/utils.py:166:11: F821 undefined name 'foo'

So for ones that start with F, make them high.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant