Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify which python version pylint should evaluate for

I'm using Sublime Text 3 With Pylinter to run pylint on my files.

However, on the same machine, I work on files for both python 2, and python 3 projects (the code is executed on one of several remote test-VMs, via SSH. I'm modifying the files by opening them over SMB. This is my home test-lab, and I'm finally sitting down to learn py3k).

Can I easily override the mechanism pylint uses to determine the python version it should lint for? Ideally, there would be an inline directive, but I have not had much luck finding anything.

I'm (editing) on Windows (the remote VMs are linux, but that' irrelevant here), for what it's worth.

like image 774
Fake Name Avatar asked Apr 14 '14 05:04

Fake Name


People also ask

How do I check Pylint version?

First, to check the version of Pylint you're running, run the following command: pylint --version.

Does Pylint support Python 3?

Pylint is a static code analyser for Python 2 or 3. The latest version supports Python 3.7.

What does Pylint check for?

Pylint analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored. Pylint can infer actual values from your code using its internal code representation (astroid).


1 Answers

You can try python2 -m pylint ... and python3 -m pylint .... That ensures that you use the right version.

like image 192
chris Avatar answered Sep 25 '22 13:09

chris