No project description provided
Project description
flake8-pydantic-fields
A flake8 plugin that checks that Pydantic models have default values which are Fields, and that those fields have descriptions. This encourages data documentation.
This package adds the following warnings:
PF001: A Pydantic field which has no default.PF002: A Pydantic field with a default that is not a Field.PF002: A Pydantic field which has a Field default with no description.
There are no configuration options at this time.
This package uses heuristics to determine whether a class is a Pydantic model. While this could be accomplished by running the code, that is not in the spirit of static analyzers, and it would be considerably slower.
The heuristics are:
It is not a Pydantic model if:
- The class has no base classes.
- The class is annotated with
@dataclass.
It is a Pydantic model if:
- The name of the base class is
BaseModelorGenericModel. - The class contains only annotated assignments.
- The class has at least one method decorated with
@validatoror@root_validator. - The class contains an inner
Configclass.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file flake8-pydantic-fields-0.1.4.tar.gz.
File metadata
- Download URL: flake8-pydantic-fields-0.1.4.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77902fe6e71f10e0ccc3b032e9b49b600423bcf6dcef6958cd04455b910ab823
|
|
| MD5 |
c524c4ee423535a1fddc83db91854561
|
|
| BLAKE2b-256 |
9c31df63707602ba6b671035fb0ebfd79de8ef8bb9025db7f636f11ac9e90443
|