jendrikseipp / vulture

Find dead Python code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pydantic false positive

nosid91 opened this issue · comments

We often use Pydantic in our projects. There are several problems with Pydantic classes.
1)

src/employee/models.py:11: unused variable 'first_name' (60% confidence)
src/employee/models.py:12: unused variable 'middle_name' (60% confidence)
src/employee/models.py:13: unused variable 'last_name' (60% confidence)

for model:

    id: UUID4
    first_name: str
    middle_name: str
    last_name: str
  1. It completely ignores Pydantic classes and does not check their usage. It only checks the variables from the example above

vulture 2.5

Thanks for the report! Since Vulture cannot detect that this code is actually used, I recommend adding the variables to a whitelist file (see README.md).