settings-base-class (BTCONF002)¶
Added in 0.10.0 · Preview · Off by default (warning)
Family: config · Standard: CES-76 · Languages: python
This rule is unstable and in preview. It runs only with preview = true, and only when it is selected.
Directive¶
A class whose name ends with Settings extends pydantic_settings.BaseSettings, not
BaseModel. A warning by default.
Why¶
A BaseModel named Settings reads nothing from the environment: the values are filled in by
hand, usually with the os.environ reads that the standard keeps in one place.
Do¶
Don't¶
Suppression¶
A comment on the class line silences the finding.