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

Support pylint output #20

Closed
tuukkamustonen opened this issue Oct 24, 2016 · 10 comments
Closed

Support pylint output #20

tuukkamustonen opened this issue Oct 24, 2016 · 10 comments

Comments

@tuukkamustonen
Copy link

tuukkamustonen commented Oct 24, 2016

Add support for reading pylint-format.

pylint --output-format=parseable --reports=n . > pylint.out

I tried configuring pylint.out file as FLAKE8 source file, but it produces something like:

************* Module fs.libcheck.libcheck
/home/musttu/Code/virtualenvs/cosmos/lib/python3.4/site-packages/fs/libcheck/libcheck.py:322: [C0330(bad-continuation), ] Wrong hanging indentation before block (add 4 spaces).
                    name == 'used_in_products' and self.presets.get('product') and
                    ^   |

Plugin output:

Dangling meta character '*' near index 0
*/pylint\.out
^

Pylint is also used by prospector. It allows reporting violations from various tools in pylint-format, so supporting pylint would tackle a bunch of tools. Prospector also supports other output formats (json, yaml, etc.), but I think those formats are less de-facto and supporting pylint would be the best bet.

@tuukkamustonen
Copy link
Author

Uh, too many expectations and I should actually read the error message before opening a ticket. Apparently this was caused by an invalid regex to file pattern...

@tuukkamustonen
Copy link
Author

@tomasbjerre Although, it's a bit confusing that front page says:

image

while Flake8- and Pylint-formats are different and flake8 does not execute pylint internally.

If the tool really already supports pylint-output, I would suggest to change README as:

- Flake8 (Pep8, Mccabe, PyFlakes) / PyLint

And on configuration page, put:

FLAKE8 / PYLINT:    _______________________

...just to make it more evident?

@tomasbjerre
Copy link
Contributor

I can add a pylint parser if you have a sample pylint report? Command for generating it and its output.

@tuukkamustonen
Copy link
Author

@tomasbjerre
Copy link
Contributor

I just released this. Should be in the Jenkins update center within a few hours.

@tuukkamustonen
Copy link
Author

Thanks, I'll give it a spin tomorrow!

@tuukkamustonen
Copy link
Author

It seems to work, but it be possible to include also the "numeric" rule ID into Rule field:

Found 1 violation:
Reporter: PYLINT
Rule: anomalous-backslash-in-string
Severity: WARN
File: fs/csm/admin_api/admin_api.py L1086

Anomalous backslash in string: '\s'. String constant might be missing an r prefix.
<this is a auto generated comment from violation-comments-lib F7F8ASD8123FSDF>

Normally you discuss/ignore/google per rule ID (e.g. E1101) rather than it's label. Perfect output would be something like:

Rule: W1401(anomalous-backslash-in-string)

@tomasbjerre
Copy link
Contributor

Should be fixed in 1.31!

@tomasbjerre
Copy link
Contributor

I just realized I missed the severity level... I'll fix that later.

@tomasbjerre
Copy link
Contributor

Open issue again if not fixed!

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

2 participants