Skip to content

Pylint - it appears pylint is linting the pylintrc file and throwing errors that affect every other module #506

Closed

Description

@opethe1st

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

Activity

  1. changed the title [-]pylint - it appears pylint is linting the pylintrc file and throwing errors that affect every other module[/-] [+]Pylint - it appears pylint is linting the pylintrc file and throwing errors that affect every other module[/+] on Jan 1, 2018
  2. brettcannon commented on Jan 2, 2018

    @brettcannon
    Member

    Have you tried deleting the line from your pylintrc file? There might be some whitespace formatting at the line ending or something that is throwing Pylint off.

  3. opethe1st commented on Jan 4, 2018

    @opethe1st
    Author

    yes, I have, the error persists. I deleted it just now and it is effectively the same as commenting out the line which I did above too.

  4. DonJayamanne commented on Jan 22, 2018

    @DonJayamanne

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

  5. opethe1st commented on Jan 24, 2018

    @opethe1st
    Author

    I pushed all the relevant files i can think of - up to this branch - https://github.com/opethe1st/SameGame/tree/pylint-bug

  6. opethe1st commented on Jan 24, 2018

    @opethe1st
    Author

    actually - a better example is this https://github.com/opethe1st/demo . just a print statement, and .pylintrc and the error is still there.

  7. DonJayamanne commented on Jan 24, 2018

    @DonJayamanne

    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.

  8. added and removed
    info-neededIssue requires more information from poster
    bugIssue identified by VS Code Team member as probable bug
    on Jan 24, 2018
  9. opethe1st commented on Jan 25, 2018

    @opethe1st
    Author

    thanks, won't have guessed

  10. locked as resolved and limited conversation to collaborators on Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions