Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode pylint on all project files without opening them

I'm looking for a solution to run pylint in vscode on all files of my project without need to open them (like checkstyle in eclipse on Java).

Thank you.

like image 686
MilacH Avatar asked Mar 07 '17 15:03

MilacH


1 Answers

Doing this is currently not possible (see https://github.com/Microsoft/vscode-python/issues/82).

Fortunately you can achieve a similar thing using vscode tasks (see https://github.com/Microsoft/vscode-python/issues/82).

{
    "label": "pylint: whole project",
    "type": "shell",
    "command": ".venv/bin/pylint --msg-template \"{path}:{line}:{column}:{category}:{symbol} - {msg}\" mycloud",
    "windows": {
        "command": ".venv/Scripts/pylint --msg-template \"{path}:{line}: {column}:{category}:{symbol} - {msg}\" mycloud"
    },
    "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
        }
    }
}
like image 179
Thomas Gassmann Avatar answered Nov 02 '22 21:11

Thomas Gassmann