Skip to content

Question/Idea: Lint full directory/project #82

Closed

Description

From @mdalpi on February 1, 2017 20:9

Hi.

There's any way to lint the whole project directory instead of only open files (and the errors will be displayed accordingly, error by file in problems view)?

I think it'll be great to have this with Flake8 at least (maybe PyLint is a little slow to lint the whole project after every save).

Thanks 😄

Copied from original issue: DonJayamanne/pythonVSCode#694

Activity

  1. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    From robomojo on February 12, 2017 12:5

    I have been searching for the same thing and it seems to be a missing vscode feature.
    microsoft/vscode-eslint#91
    microsoft/vscode#13953
    Currently the method of doing this with pylint is just to use the terminal pylint . -E, but it would be nice if that output fed directly into the problems panel so I could click through to the errors.

  2. DonJayamanne commented on Nov 13, 2017

    @DonJayamanne
    Author

    Ability to run as a task and report problems. (contribute problem matchers)

  3. brettcannon commented on Jan 17, 2018

    @brettcannon
    Member

    Mikhail Arkhipov (@MikhailArkhipov) as part of your linting work, could you see what it would take to add some "Lint workspace" command? E.g. would every linter need a custom setting because they all have a custom way to do recursion?

  4. 11 remaining items

  5. konstantint commented on May 19, 2018

    @konstantint

    I'm using this task definition. It is far from perfect, but kind-of gets the job done.
    For example, the problem list gets emptied and re-populated when you click on a line to open the file. This can be fixed by setting owner="pylint", but then you get every problem listed twice - once from the "official" pylint and once from this task. Also the message categories are parsed incorrectly ("convention" is interpreted as "critical").

    Note that you need to adapt this to your project (set the correct path to pylint and the name of the root package (instead of myproject tests) in the two command records).

    {
    	"label": "pylint: whole project",
    	"type": "shell",
    	"command": "venv/Scripts/pylint --msg-template \"{path}:{line}:{column}:{category}:{symbol} - {msg}\" myproject tests",
    	"windows": {
    		"command": ".\\venv\\Scripts\\pylint.exe --msg-template \"{path}:{line}:{column}:{category}:{symbol} - {msg}\" myproject tests"
    	},
    	"presentation": {
    		"reveal": "never",
    		"panel": "shared"
    	},
    	"problemMatcher": {
    		"owner": "python",
    		"fileLocation": ["relative", "${workspaceFolder}"],
    		"pattern": {
    			"regexp": "^(.+):(\\d+):(\\d+):(\\w+):(.*)$",
    			"file": 1,
    			"line": 2,
    			"column": 3,
    			"severity": 4,
    			"message": 5
    		}
    	}
    },
    
  6. zen-crab commented on May 23, 2018

    @zen-crab

    I noticed this was marked done, does that mean there's a way to enable full project linting in the current or development releases of the vscode-python extension?

  7. brettcannon commented on May 24, 2018

    @brettcannon
    Member

    @sbmelvin this is not marked as done.

  8. removed this from the June 2018 milestone on Jun 4, 2018
  9. MikhailArkhipov commented on Jun 20, 2018

    @MikhailArkhipov

    @sbmelvin - this is implemented in Microsoft Python Language server which is in experimental state. You can try it by setting python.jediEnabled: false and reloading VSC. LS will be downloaded as needed for the target OS.

  10. zen-crab commented on Jun 20, 2018

    @zen-crab

    Mikhail Arkhipov (@MikhailArkhipov) I'll give that a try. Do I need to use the development release for this?

  11. MikhailArkhipov commented on Jun 20, 2018

    @MikhailArkhipov

    @sbmelvin, no, works in regular.

  12. locked as resolved and limited conversation to collaborators on Oct 15, 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

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions