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:
PYD001: A Pydantic field which has no default.PYD002: A Pydantic field with a default that is not a Field.PYD002: 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.
Metadata
Release files for flake8-pydantic-fields 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8-pydantic-fields-0.1.1.tar.gz | 3.7 kB | Details |
Release files / flake8-pydantic-fields-0.1.1.tar.gz
| Download URL | flake8-pydantic-fields-0.1.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8efb8388fbe3e811204760cad378ecb9ea15a927299f3f10cf7ea8fd82fdf1ac
|
|
BLAKE2b-256 checksum How to use checksums |
73fb0b1fcdefd252cbeb2caf4e204fd4ca9cc211a70467638c3cc8dd4afb73ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|