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

Add pylint formatter #151

Merged
merged 1 commit into from
Oct 30, 2016
Merged

Add pylint formatter #151

merged 1 commit into from
Oct 30, 2016

Conversation

keith
Copy link
Contributor

@keith keith commented Oct 27, 2016

This customizes the output format of pylint in order to use the same
pep8 parser

One thing to note here, pylint likes to output lots of comments or warnings, both of which use -- in the gutter. There's a possibility we'd prefer the warnings to be displayed with >>, but I'll leave that up for debate here.

call ale#linter#Define('python', {
\ 'name': 'pylint',
\ 'executable': 'pylint',
\ 'command': 'pylint --output-format text --msg-template="{path}:{line}:{column}: {msg_id} {msg}" --reports n %s',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a problem here. I think you're formatting in the filename, which means that the linter is running on the version of the file on disk, but not on the contents of the current buffer. You should try using ale#util#stdin_wrapper, which is used in some other linters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I was wondering why many linters were using stdin. I will update this. I don't think we should need the wrapper here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes we do, looking into this now.

This customizes the output format of pylint in order to use the same
pep8 parser
@keith
Copy link
Contributor Author

keith commented Oct 28, 2016

I've updated this to use the stdin wrapper. One problem I had while doing that was temp files with _ in their path, I had to add that to the regex for this to work. Also it seemed like - was consuming : characters until it was escaped as well.

@w0rp
Copy link
Member

w0rp commented Oct 30, 2016

Cool, I'll take this and add it to the README and help file after I look at some other pull requests.

@w0rp w0rp added the new tool Support for new linters, fixers, etc. label Oct 30, 2016
@w0rp w0rp merged commit e9bbbbd into dense-analysis:master Oct 30, 2016
@keith keith deleted the ks/pylint branch October 30, 2016 09:54
@keith
Copy link
Contributor Author

keith commented Oct 30, 2016

Awesome, thank you!

@dbrodie
Copy link

dbrodie commented Nov 28, 2016

Would it be possible to add an args callback like exists for flake8 to allow for disabling certain warnings, etc...?

@w0rp
Copy link
Member

w0rp commented Nov 28, 2016

Yeah, you can open an issue for that and I or someone else will look at it eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new tool Support for new linters, fixers, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants