While developing I used
from pydantic import ValidationError
.
.
.
from jsonschema.exceptions import ValidationError
I used the first imports but further I added another second import which resulted in not catching the expected result .but vscode did not throw any error notifying about the duplicate import or something as such.
As a result I was not able to catch the expected error as the actual one was over written.
Is there a way in vscode where it will give a squilly or some warning to notify that this current import is used or over written ?
2
Answers
Flake8 has a rule that warns you about redifinition.
Considering
toto.py
Using flake8 via command line:
If you absolutely need it within VSCode, there is an
extension for it:
You can get warnings through Linting, now you can still enable it with the following settings
But it is better to install the linting extension(such as Pylint), because this is what Microsoft recommends.