sourcery_analytics.settings

Models describing sourcery-analytics settings.

class sourcery_analytics.settings.ThresholdSettings(*, method_length: PositiveInt = 15, method_cyclomatic_complexity: PositiveInt = 10, method_cognitive_complexity: PositiveInt = 10, method_working_memory: PositiveInt = 20)

Bases: BaseModel

Model describing the available thresholds and their defaults.

method_length: PositiveInt
method_cyclomatic_complexity: PositiveInt
method_cognitive_complexity: PositiveInt
method_working_memory: PositiveInt
class sourcery_analytics.settings.Settings(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, thresholds: ThresholdSettings = ThresholdSettings(method_length=15, method_cyclomatic_complexity=10, method_cognitive_complexity=10, method_working_memory=20))

Bases: BaseSettings

Model describing general sourcery-analytics settings and their construction.

thresholds: ThresholdSettings
classmethod from_toml_file(toml_file_path: Path)

Construct settings from a toml file.

Parameters

toml_file_path – Relative or fully-qualified path to a toml file containing sourcery-analytics settings.

Returns

A Settings instance.