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:
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
BaseModel
orGenericModel
. - The class contains only annotated assignments.
- The class has at least one method decorated with
@validator
or@root_validator
. - The class contains an inner
Config
class.
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
Close
Hashes for flake8-pydantic-fields-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec3102d1f6c746029d004016c6e0aeeb2c8cdaec01133d14549548b3e030768f |
|
MD5 | c0a01629eadf3ee491c8d6c3b0fa5809 |
|
BLAKE2b-256 | 51f98e2bfaefca40abc2b5b66f01eebe72a91eb0576a032a745d2e1535bf1209 |