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

Minimap does not show all lint warnings #19119

Closed
LiveFreeAndRoam opened this issue May 10, 2022 · 4 comments
Closed

Minimap does not show all lint warnings #19119

LiveFreeAndRoam opened this issue May 10, 2022 · 4 comments
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@LiveFreeAndRoam
Copy link

LiveFreeAndRoam commented May 10, 2022

Issue Type: Bug

Behaviour

Notice in the image below, that only two of the three lint warnings are displayed in the minimap. The minimap is not displaying the refactor warning.

Also, the refactor warning is just 3 dots under def (line 12), which by itself is difficult to notice. For consistency, it ought to be a wavy line, like the other lint warnings (lines 1 and 8).

image

Expected vs. Actual

The linter uses a difficult to notice highlight for some lint warnings (e.g. refactor warnings), and further it is not displayed in the minimap. This is causing me to miss linter notifications.

test_linter.py

def map():
    """ a """
    return True


def disallowed_name(val):
    """ a """
    foo = val
    return foo


def too_many_args(al, ba, ca, da, ef, ff, gf):
    """ foo """
    return al, ba, ca, da, ef, ff, gf

Linter Output

> ~/.pyenv/versions/3.8.5/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.0/pythonFiles/linter.py -m pylint --rcfile ./common/test/pylint.rc ./common/pylib/vmedia/vmedia/test_linter.py
cwd: .
##########Linting Output - pylint##########

[
    {
        "type": "warning",
        "module": "vmedia.test_linter",
        "obj": "map",
        "line": 1,
        "column": 0,
        "endLine": null,
        "endColumn": null,
        "path": "/work/muggeridge/h3/h3-mfw/common/pylib/vmedia/vmedia/test_linter.py",
        "symbol": "redefined-builtin",
        "message": "Redefining built-in 'map'",
        "message-id": "W0622"
    },
    {
        "type": "convention",
        "module": "vmedia.test_linter",
        "obj": "disallowed_name",
        "line": 8,
        "column": 4,
        "endLine": null,
        "endColumn": null,
        "path": "/work/muggeridge/h3/h3-mfw/common/pylib/vmedia/vmedia/test_linter.py",
        "symbol": "disallowed-name",
        "message": "Disallowed name \"foo\"",
        "message-id": "C0104"
    },
    {
        "type": "refactor",
        "module": "vmedia.test_linter",
        "obj": "too_many_args",
        "line": 12,
        "column": 0,
        "endLine": null,
        "endColumn": null,
        "path": "/work/muggeridge/h3/h3-mfw/common/pylib/vmedia/vmedia/test_linter.py",
        "symbol": "too-many-arguments",
        "message": "Too many arguments (7/6)",
        "message-id": "R0913"
    }
]

Steps to reproduce:

Run the linter against the program shown above, test_linter.py.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.5
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Pyenv
  • Value of the python.languageServer setting: Default
User Settings


defaultLS: {"defaultLSType":"Pylance"}

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: false
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "autopep8"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.6.0
VS Code version: Code 1.67.0 (57fd6d0195bb9b9d1b49f6da5db789060795de47, 2022-05-04T12:06:02.889Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
Remote OS version: Linux x64 5.3.18-24.96-default

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2712)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 63.88GB (49.70GB free)
Process Argv --folder-uri vscode-remote://ssh-remote%2Bmfw30/work/muggeridge/h3/h3-gui --crash-reporter-id 386826ce-1d78-47e2-b6bd-34ee0c3d715f
Screen Reader no
VM 0%
Item Value
Remote SSH: mfw30
OS Linux x64 5.3.18-24.96-default
CPUs Intel(R) Xeon(R) Platinum 8180 CPU @ 2.50GHz (72 x 2499)
Memory (System) 376.14GB (19.28GB free)
VM 100%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebugcf:30475217
vsclangdf:30486550

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label May 10, 2022
@karthiknadig
Copy link
Member

@LiveFreeAndRoam You can change the severity of refactor messages to be more visible. If that is not sufficient, then this is a feature request on VS Code to allow better control of what is shown in the minimap.

@LiveFreeAndRoam
Copy link
Author

LiveFreeAndRoam commented May 11, 2022

Can you describe how I elevate the severity of refactor messages?

I searched for that as a workaround, but only found this pylint feature request (open since 2018)...

Add configuration to promote/demote severity of messages
pylint-dev/pylint#2293

@karthiknadig
Copy link
Member

@LiveFreeAndRoam you can add this to your settings.json:

"python.linting.pylintCategorySeverity.refactor": "Information"

@LiveFreeAndRoam
Copy link
Author

Perhaps this could be improved in the documentation? I previously read the Pylint section, but it didn't register that changing the mapping would also impact what is seen in the minimap.

E.g. maybe this Pylint doc could have an example made from this case?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants