2

My environment: Mac, Python 3.9, venv.

This is the file I want to lint (editor isn't showing linting). enter image description here

import pandas as pd

df = pd.DataFrame()
fc = 1

Running the linter in command line returns the expected: enter image description here

I already checked various SO entries and applied following proposed solutions

  1. In vscode I enabled linting, selected pylint as linter and run

  2. I disabled the minimal checkers. My .vscode/settings.json:

    {
    "python.linting.pylintUseMinimalCheckers": false,
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.pythonPath": "venv/bin/python"
    }
    
  3. Created a .pylintrc with pylint --generate-rcfile -encoding utf8 > ~/.pylintrc

Any idea how to fix this?

Zin Yosrim
  • 1,602
  • 1
  • 22
  • 40
  • Can you check Output console tab? Various plugins post error messages there. There are multiple sub-consoles so you might need to poke around a bit. – Mikko Ohtamaa Nov 30 '20 at 10:56
  • 1
    checked all tabs, no linting related output. Just `[INFO 11:50:55.902] autoDocstring was activated` – Zin Yosrim Nov 30 '20 at 11:17

2 Answers2

2

Based on your description, it is recommended that you check the following two files:

  1. Please check whether the settings file "settings.json" contains "python.linting.pylintArgs": [], related settings.

    In addition to the ".vscode/settings.json" you provided, we should also pay attention to check whether the global setting "User/settings.json" contains the above settings, it will turn off the Pylint information if the content is set.

    for example: "python.linting.pylintArgs":[ "----extension-pkg-whitelist=1xml" ] This has closed content, so it will close Pylint information. Please comment out this setting.

  2. Since you created the file ".pylintrc", please check whether the file contains like

disable=
     C0114, # missing-module-docstring
     C0103, # invalid-name"

related settings, it will turn off specific Pylint notifications.

Effect:

enter image description here

The content of my ".vscode/settings.json" is basically the same as yours. The following is the content of my "User/settings.json":

{
  
  "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
  "workbench.iconTheme": "vscode-icons",
  "files.autoSave": "afterDelay",
  "files.autoSaveDelay": 1000,
  "python.linting.enabled": true, 
  "python.languageServer": "Microsoft",
  
       
}
Jill Cheng
  • 9,179
  • 1
  • 20
  • 25
  • 1
    Adding `"python.linting.pylintArgs": []` to `.vscode/settings.json` resolved the issue. many thanks for the valuable hint – Zin Yosrim Dec 04 '20 at 08:16
  • I also checked my User `settings.json` where I found `"python.linting.pylintArgs": [ "--rcfile", "${workspaceFolder}/backend/.pylintrc" ]`. Obvously this caused the issue. Can I safely remove what's inside the brackets? – Zin Yosrim Dec 04 '20 at 08:26
  • @zinyosrim -Yes, this is exactly what is suggested in my answer (1.). Please comment out this setting. It will turn off Pylint information if the content is set, and it is also available if the content of this setting is empty. – Jill Cheng Dec 04 '20 at 08:29
0

I saw that you disabled Minimal checkers in your config file, but it works for me with VScode GUI support so let's give it a try:

Config - When I use pylint as the Linter and Minimal checkers is disabled: enter image description here

Result - Global variable in lowerCase is generating a message. enter image description here

NOTE: Please make sure that you are using Pylint as linter (like in the first image attached).

BarT
  • 317
  • 2
  • 10