question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The lint highlighter is marking the whole function for missing-function-docstring

See original GitHub issue

Issue Type: Bug

Behaviour

Expected vs. Actual

Expected: Before the most recent VSCode update, this would only make a small highlight on the first line of where the function is defined.

Actual: Linter will mark every line of the function with blue squiggly underlines, which is very distracting and makes it hard to see other linting issues. Screenshot from 2022-02-06 16-13-52

Steps to reproduce:

  1. Make a python file.
  2. Define a function in the python file without adding a docstring.
  3. Enable pylint for the python file in VSCode.

Diagnostic data

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


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

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: true
• 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: "black"
• 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: false
• optInto: []
• optOutFrom: []

insidersChannel: "off"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.0.1786462952 VS Code version: Code 1.64.0 (5554b12acf27056905806867f251c859323ff7e9, 2022-02-03T04:23:11.224Z) OS version: Linux x64 5.4.0-97-generic snap Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i7-9750H CPU @ 2.60GHz (12 x 4000)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 0, 0, 0
Memory (System) 15.47GB (6.42GB free)
Process Argv –no-sandbox --new-window /home/stian/LocalProjects/DeepLearning/optinet2 --crash-reporter-id 555d8fe7-2706-4fd0-b0bc-868f0b306f7a
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
pythonvspyl392:30425749
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dsc:30433058
pythonvs932:30410667
wslgetstarted:30433507
vs360cf:30404996
vsclayoutctrt:30425946
vsrem710cf:30416617
vscop841:30430977
vscscmwlcmc:30433760

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
astrowonkcommented, Feb 8, 2022

Ah, I was changing the version of python extension locally not on my remote. Reverting to Python extension v2021.12.1559732655 also fixes the issue, though probably easier to pin pylint.

A workaround would be to let vscode python users disable using error ranges…

2reactions
karthiknadigcommented, Feb 8, 2022

If you pin pylint=2.11.1 it might work better. This change was added in version 2022.0.* (see here https://github.com/microsoft/vscode-python/blob/0856eb26cbcc3a2ec5e15edaa6ef9cdddca32790/CHANGELOG.md?plain=1#L15)

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How do you fix "Missing module docstringpylint ...
I think the warning missing doc string is from your py file not from import random. Try adding some doc string at the...
Read more >
C0116 (missing-function-docstring) | pylint-errors
Missing function or method docstring used when a function or method has no docstring. Some special methods like __init__ , protected, private functions, ......
Read more >
Pylint features - Pylint 2.16.0-dev documentation
Missing function or method docstring Used when a function or method has no docstring. Some special methods like __init__ do not require a...
Read more >
ESLint | IntelliJ IDEA Documentation - JetBrains
IntelliJ IDEA integrates with ESLint which brings a wide range of linting rules that can also be extended with plugins.
Read more >
Changelog — Python 3.11.1 documentation
gh-96388: Work around missing socket functions in socket 's __repr__ . ... gh-90081: Run Python code in tracer/profiler function at full speed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found