Pylint Pydantic Plugin

0.4.1 · active · verified Sat Apr 11

Pylint-pydantic is a Pylint plugin designed to enhance Pylint's understanding of Pydantic models, reducing false positives and improving static analysis for Pydantic-heavy codebases. The current version is 0.4.1, and it maintains an active release cadence, frequently updating to support new major versions of Pylint and Pydantic, as well as addressing bug fixes.

Warnings

Install

Imports

Quickstart

Define a Pydantic model, then run `pylint` with the `--load-plugins pylint_pydantic` argument to apply the plugin's checks to your file.

from pydantic import BaseModel, Field

class User(BaseModel):
    name: str = Field(min_length=1)
    age: int

# Save this as 'my_models.py'
# Then run pylint from your terminal:
# pylint --load-plugins pylint_pydantic my_models.py

view raw JSON →