Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint makes "Quick Fix" suggestions take 10s+ to load #567

Open
masterbbud opened this issue Jul 25, 2024 · 0 comments
Open

Pylint makes "Quick Fix" suggestions take 10s+ to load #567

masterbbud opened this issue Jul 25, 2024 · 0 comments
Assignees
Labels
triage-needed Issue is not triaged.

Comments

@masterbbud
Copy link

I'm using a combination of several linters in order to analyze my Python code using VSCode, including Pylint (alongside Ruff, CodeSpellChecker, and Pylance). Pylint is notably quite slow, although I have a rather large Python codebase, so this is reasonable. The issue for me is that Pylint causes the "quick fix" suggestions (from hovering over warnings or the shortcut Ctrl + .) to take upwards of 10 seconds to load. This happens on all VSCode warnings, even the ones that are generated by Ruff/Pylance (and are not a Pylint issue). I can't seem to pinpoint anything in the logs, but here is an example of what it looks like to hover over a warned element:

(The item was hovered at 4:54:51 and quick fix suggestions showed up at 4:54:59)

2024-07-25 16:54:51.223 [info] [Trace - 4:54:51 PM] Received notification 'window/logMessage'.
2024-07-25 16:54:51.223 [info] <FILENAME> :
[]

2024-07-25 16:54:51.224 [info] [Trace - 4:54:51 PM] Received notification 'textDocument/publishDiagnostics'.
2024-07-25 16:54:51.226 [info] [Trace - 4:54:51 PM] Received notification 'textDocument/publishDiagnostics'.
2024-07-25 16:54:51.228 [info] [Trace - 4:54:51 PM] Received response 'textDocument/codeAction - (16)' in 6839ms.
2024-07-25 16:54:51.229 [info] [Trace - 4:54:51 PM] Received response 'textDocument/codeAction - (17)' in 6351ms.
2024-07-25 16:54:51.233 [info] [Trace - 4:54:51 PM] Received notification 'window/logMessage'.
2024-07-25 16:54:51.233 [info] <MY PYTHON PATH> -m pylint --reports=n --output-format=json --rcfile=<MY USER PROFILE>\.vscode\pyproject.toml --clear-cache-post-run=y --from-stdin <FILENAME>
2024-07-25 16:54:51.233 [info] [Trace - 4:54:51 PM] Received notification 'window/logMessage'.
2024-07-25 16:54:51.233 [info] CWD Linter: <WORKSPACENAME>
2024-07-25 16:54:59.164 [info] [Trace - 4:54:59 PM] Received notification 'window/logMessage'.
2024-07-25 16:54:59.164 [info] <FILENAME> :
[
    {
        "type": "error",
        "module": "<MODULE>",
        "obj": "",
        "line": 22,
        "column": 0,
        "endLine": 22,
        "endColumn": 52,
        "path": "<PATH>",
        "symbol": "import-error",
        "message": "Unable to import '<MODULENAME>'",
        "message-id": "E0401"
    },
    {
        "type": "error",
        "module": "<MODULE>",
        "obj": "",
        "line": 22,
        "column": 0,
        "endLine": 22,
        "endColumn": 52,
        "path": "<PATH>",
        "symbol": "no-name-in-module",
        "message": "No name 'test_utils' in module '<MODULENAME>'",
        "message-id": "E0611"
    }
]

2024-07-25 16:54:59.165 [info] [Trace - 4:54:59 PM] Received notification 'textDocument/publishDiagnostics'.
2024-07-25 16:54:59.167 [info] [Trace - 4:54:59 PM] Received response 'textDocument/codeAction - (18)' in 13813ms.
2024-07-25 16:54:59.498 [info] [Trace - 4:54:59 PM] Sending request 'textDocument/codeAction - (19)'.
2024-07-25 16:54:59.505 [info] [Trace - 4:54:59 PM] Received response 'textDocument/codeAction - (19)' in 8ms.

Here is my configuration used, in case it helps:

[
    {
        "cwd": "<MY WORKSPACE FOLDER>",
        "workspace": "<MY WORKSPACE>",
        "args": [
            "--rcfile=<MY USER PROFILE>\\.vscode\\pyproject.toml"
        ],
        "severity": {
            "convention": "Information",
            "error": "Error",
            "fatal": "Error",
            "refactor": "Information",
            "warning": "Warning",
            "info": "Information"
        },
        "path": [],
        "ignorePatterns": [],
        "interpreter": [
            "<MY PYTHON PATH>"
        ],
        "importStrategy": "useBundled",
        "showNotifications": "off",
        "extraPaths": [
            ".."
        ]
    }
]

I only use Pylint for a small number of rules - I would be very happy to turn off Pylint "quick fix" suggestions entirely (but not the linter warnings), if that is something that I can configure. Please let me know of the best path to take.

@github-actions github-actions bot added the triage-needed Issue is not triaged. label Jul 25, 2024
@karthiknadig karthiknadig self-assigned this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

2 participants