question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pylint checks with pylance enabled

See original GitHub issue

Dunno if this should be a bug report or feature request…

First of all, I just installed and used pylance as the language server for my vscode and it is indeed SUPER! thanks.

However, I had setup plenty of custom python.linting.pylintArgs to check in my code, for example on my most occuring bugs are trailing-comma-tuple and more, after switching python.languageServer to "Pylance" these checks stopped being checked for.

As said, I would consider this a feature request that pylance should support these checks.

Another example is, unused variables, in pylint I got unused variables error for unused arguments in function signatures, while pylance only checks for code blocks, i.e.;

def function(a, b):
    c = 42
    return a

pylint would complain about b and c being unused, while pylance only complains about c.

Once again, super cool linter!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:11
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
petterssonandreascommented, Oct 1, 2020

I found out about pylance just a couple of days ago and enabled it. It is very nice, but I too lost all my linting from pylint. I found this issue after searching for a solution.

After some more trial, I seem to have been able to re-enable pylint without changing the language server (i.e. I get both pylance and pylint warnings). I did this by explicitly enabling pylint in my settings.json file. So my settings.json now include, among other lines:

    "python.linting.pylintEnabled": true,
    "python.languageServer": "Pylance",

I had to make the change manually in settings.json, just checking the setting “Python > Linting: Pylint Enabled” in the graphical settings meny in VSCode was not enough (that was marked as enabled the whole time). Why this works I don’t really know, but it seems to work for me at least. Also, the order of the lines in settings.json doesn’t seem to matter. I have tried this on both a Linux and a Windows machine.

I hope this can help someone else.

Windows machine config: VSCode: 1.49.2 Python: 3.8.5 Pylint: 2.6.0 Python extension: 2020.9.112786 Pylance extension: 2020.9.7

4reactions
astrelskycommented, Jul 11, 2021

This is still a problem. Pylance does almost no linting in comparison to pylint. The linter enabled in the settings should not be silently disabled when enabled in the settings via the user interface. I have yet to try explicitly setting it in the json settings but it shouldn’t be necessary.

If I could use pylance and vscode at work and not get hounded during code review for code formatting issues that the linter would have caught, that’d be great.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linting Python in Visual Studio Code
To enable linters, open the Command Palette (Ctrl+Shift+P) and select the Python: Select Linter command. The Select Linter command adds "python.linting.<linter> ...
Read more >
Disable specific Pylance linting messages in VS Code settings ...
Here, one can find a few ways to customize Pylance, but there is nothing about how to suppress, mute or actually disable certain...
Read more >
VSCode and Pylint configuration - MicroPython-Stubber!
Specifies whether to enable Pylint. Pylance - pyright¶. [Pylance](Pylance - Visual Studio Marketplace) is replacing MPLS and provides the same ...
Read more >
Have you tried Pylance for VS Code? If not, here's why you ...
However, with Pylance, enabling the type checking setting (see below) will help you understand if your code violates any documented type hints.
Read more >
Python in Visual Studio Code - November 2022 Release
We're excited to announce that the November 2022 release of the Python and Jupyter extensions for Visual Studio Code are now available!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found