Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code: how to be warned of missing functions?

Using flake8 as my linter, if I write some Python code that references a non-existent function in the same file, VS Code flags it up as an undefined variable. However, if I try to reference a non-existent function in a class, it doesn't. For example:

class Foo:
    def bar(self):
        return

one = Foo()
one.bar()  # No warning
one.foo()  # No warning either!

doesn't generate any warnings against the one.foo() line.

Is there a setting I need to change in the VS Code Python extension to get this to work or is it a limitation of the system?

Edited to make it clear that I was using flake8. All of the suggested solutions mention pylint which does work. I'm still interested in whether or not this can work with flake8 but pylint is working for me as an alternative.

like image 427
Philip Colmer Avatar asked Nov 02 '25 01:11

Philip Colmer


1 Answers

Just set pylint and yo will have it.

enter image description here

like image 107
prosti Avatar answered Nov 03 '25 17:11

prosti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!