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 - it appears pylint is linting the pylintrc file and throwing errors that affect every other module

See original GitHub issue

Environment data

VS Code version: 1.19.1 Python Extension version: 0.9.1 Python Version: 3.6.4 OS and version: MacOS 0.13.2 - High Sierra

Actual behavior

Shows an error line 6 when line 6 is actually empty and even when I add newlines, the error is always on line 6. What I noticed was that if I commented out line6 in my .pylintrc file, the error moves to another line. And every single module I have would have the same error on the exact line. Looks like pylint is linting .pylintrc which doesn’t make sense and it doesn’t make sense how an error in pylintrc(if there is one) show up in every single file in my project.

Expected behavior

There is no error on that line. It is an empty line and even when I move my code around by adding newlines. The error remains on that line.

Steps to reproduce:

  • pip install pylint - tried this with 1.8.1, with 1.5.5 same behaviour.
  • generate rcfile pylint --generate-rc-file
  • specify rcfile for the extension

Please note that running pylint in the terminal shows no errors.

Using config file /Users/ope/Documents/code/Projects/SameGame/.pylintrc

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)```

Logs

Output from Python output panel

Using config file /Users/ope/Documents/code/Projects/SameGame/.pylintrc
************* Module .pylintrc
6,0,error,E0001:invalid syntax (<string>, line 6)

Output from Console window (Help->Developer Tools menu)

console.ts:123 [Extension Host] (node:36260) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
screen shot 2018-01-01 at 12 52 54 screen shot 2018-01-01 at 12 54 12

##Notice that the error line corresponds to the rcfile. Once I comment that line, the error line changes.

screen shot 2018-01-01 at 12 57 45 screen shot 2018-01-01 at 13 01 17

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
DonJayamannecommented, Jan 24, 2018

Here’s the fix to the settings.json (please remove the = after --rcfile:

    "python.linting.pylintArgs": [
        "--rcfile",
        "${workspaceFolder}/.pylintrc"
    ],

Thanks for the sample, was able to replicate this and identify the simple issue.

1reaction
DonJayamannecommented, Jan 22, 2018

Please could you upload the sample repo, so we could try that out at this end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

it appears pylint is linting the pylintrc file and throwing errors ...
Pylint - it appears pylint is linting the pylintrc file and throwing errors that affect every other module #506.
Read more >
pylint false positive E0401 import errors in vscode while using ...
Pylint has some quirks. In this case it doesn't know where to find your module because it's in subdirectory of your venv path....
Read more >
Pylint features - Pylint 2.16.0-dev documentation
Below is a list of all checkers and their features. ... seems to have no effect Used when a statement doesn't have (or...
Read more >
Pylint Errors | Improve Your Code with Pylint and Black
If you were linting more than one file at once and more than one contained errors, there would be multiple instances of this...
Read more >
Pylint Documentation - Read the Docs
Pylint is a tool that checks for errors in Python code, tries to enforce a coding standard and looks for code smells. It....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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