0

When pylint-django is installed error messages like Class 'MyModel' has no 'objects' member disappear. But with them being disappeared some real errors are skipped too. For example, the line MyModel.objectss.all() will not throw an error (note two s in the word objects).

Actually, I find it quite interesting, how pylint is marking errors:

  • MyModel.objects.all() (everything is correct) - gives no error.
  • MyModel.objectss.all() (two s in objects) - gives no error.
  • MyModel.objectss.alll() (two s in objects and three l in all) - gives Class 'MyModel' has no 'objectss' member.
  • MyModel.objects.alll() (three l in all) - gives no error.

It's like at least two errors must occur in order for pylint to throw an error.

I am working withVisual Studio Code 1.39.1, pylint==2.4.2, pylint-django==2.0.11

My Visual Studio's settings.json file looks like this:

{
    "python.linting.pylintArgs": [
        "--load-plugins=pylint_django"
    ]
}

So, is this a bug or is there something wrong with my config?

Artem Ilin
  • 353
  • 2
  • 19
  • Is there any message or error on Output tab on your VS Code? – Toan Quoc Ho Oct 13 '19 at 14:09
  • @ToanQuocHo Do you mean when I actually run the code? Then yes, of course the code fails. – Artem Ilin Oct 13 '19 at 17:05
  • No, I mean when you run pylint on your code. Let's say you run `pylint your_file.py ----load-plugins=pylint_django`, is it works? And when you use VSCode, does Output tab on your VSCode displayed any error or messages? – Toan Quoc Ho Oct 13 '19 at 17:45
  • @ToanQuocHo after running your command it shows only minor improvement suggestions (nothing about `objectss`). VS's Output tab with Python selected in drop down menu doesn't show any error either. Only those very suggestions just like from `pylint`'s output. – Artem Ilin Oct 13 '19 at 18:24

0 Answers0