{"id":3759,"library":"pylint-pydantic","title":"Pylint Pydantic Plugin","description":"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.","status":"active","version":"0.4.1","language":"en","source_language":"en","source_url":"https://github.com/fcfangcc/pylint-pydantic","tags":["pylint","pydantic","linter","static analysis","code quality","plugin"],"install":[{"cmd":"pip install pylint-pydantic","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"This is a plugin for Pylint and requires Pylint to function.","package":"pylint"},{"reason":"This plugin extends Pylint's capabilities specifically for Pydantic models.","package":"pydantic"},{"reason":"A utility library often used for developing Pylint plugins.","package":"pylint-plugin-utils"}],"imports":[{"note":"This is a Pylint plugin and is enabled via Pylint configuration (e.g., command line, .pylintrc, or pyproject.toml), not by a direct Python import statement in your code.","wrong":"import pylint_pydantic","symbol":"pylint_pydantic","correct":"pylint --load-plugins pylint_pydantic your_module.py"}],"quickstart":{"code":"from pydantic import BaseModel, Field\n\nclass User(BaseModel):\n    name: str = Field(min_length=1)\n    age: int\n\n# Save this as 'my_models.py'\n# Then run pylint from your terminal:\n# pylint --load-plugins pylint_pydantic my_models.py","lang":"python","description":"Define a Pydantic model, then run `pylint` with the `--load-plugins pylint_pydantic` argument to apply the plugin's checks to your file."},"warnings":[{"fix":"Upgrade Python to 3.10 or newer, or pin `pylint-pydantic<0.4.0`.","message":"Pylint-pydantic v0.4.0 dropped support for Python 3.9. Users on Python 3.9 must use an older version of the plugin or upgrade their Python interpreter.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"For Pylint 3, use `pylint-pydantic>=0.3.0,<0.4.0`. For Pylint 4, use `pylint-pydantic>=0.4.0`. Review the changelog for specific compatibility.","message":"Compatibility with Pylint major versions has changed. Pylint-pydantic v0.3.0 introduced support for Pylint 3, and v0.4.0 introduced support for Pylint 4. Ensure your `pylint-pydantic` version matches your `pylint` major version.","severity":"breaking","affected_versions":"<0.3.0 (for Pylint 3), <0.4.0 (for Pylint 4)"},{"fix":"Upgrade `pylint-pydantic` to v0.2.0 or later: `pip install --upgrade pylint-pydantic`.","message":"When using Pydantic V2, ensure you are using `pylint-pydantic` v0.2.0 or newer. Older versions may not correctly interpret Pydantic V2 features, leading to false positives or missed warnings.","severity":"gotcha","affected_versions":"<0.2.0 (with Pydantic V2)"},{"fix":"Ensure `pylint --load-plugins pylint_pydantic` is used. For older Pylint versions, you might also need to add `--extension-pkg-whitelist='pydantic'` to your Pylint arguments.","message":"Pylint may emit `no-name-in-module` or `no-member` warnings for Pydantic `BaseModel` attributes if the plugin is not correctly loaded or if an older Pylint version is used without proper configuration.","severity":"gotcha","affected_versions":"All versions (if misconfigured)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}