project_config.reporters.base module
Base reporters.
- class project_config.reporters.base.BaseColorReporter(*args: Any, colors: Optional[dict[str, str]] = None, **kwargs: Any)[source]
Bases:
BaseFormattedReporter
Base reporter with colorized output.
- _abc_impl = <_abc._abc_data object>
- format_config_key(config_key: str) str [source]
Configuration data key formatter, for example ‘style’.
- class project_config.reporters.base.BaseFormattedReporter(rootdir: str, fmt: Optional[str] = None, only_hints: bool = False)[source]
Bases:
BaseReporter
,ABC
Reporter that requires formatted fields.
- _abc_impl = <_abc._abc_data object>
- abstract format_config_key(config_key: str) str [source]
Configuration data key formatter, for example ‘style’.
- class project_config.reporters.base.BaseNoopFormattedReporter(rootdir: str, fmt: Optional[str] = None, only_hints: bool = False)[source]
Bases:
BaseFormattedReporter
Reporter that requires formatted fields without format.
- _abc_impl = <_abc._abc_data object>
- format_config_key(config_key: str) str [source]
Configuration data key formatter, for example ‘style’.
- class project_config.reporters.base.BaseReporter(rootdir: str, fmt: Optional[str] = None, only_hints: bool = False)[source]
Bases:
ABC
Base reporter from which all reporters inherit.
- _abc_impl = <_abc._abc_data object>
- errors: FilesErrors
- exception_class
alias of
ProjectConfigCheckFailed
- format
- generate_data_report(_data_key: str, _data: dict[str, Any]) str [source]
Generate data report for configuration or styles.
This method should be implemented by inherited reporters.
- abstract generate_errors_report() str [source]
Generate check errors report.
This method must be implemented by inherited reporters.
- only_hints
- raise_errors(errors_report: Optional[str] = None) None [source]
Raise errors failure if no success.
Raise the correspondent exception class for the reporter if the reporter has reported any error.
- report_error(error: ErrorDict) None [source]
Report an error.
- Parameters:
error (dict) – Error to report.
- rootdir
- exception project_config.reporters.base.InvalidColors(errors: list[str])[source]
Bases:
ProjectConfigException
Invalid not supported colors in colored formatter.
- project_config.reporters.base.bold_color(value: str, color: str) str [source]
Colorize a string with bold formatting using colored library.