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:
project_config.reporters.base.BaseFormattedReporter
Base reporter with colorized output.
- _abc_impl = <_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:
project_config.reporters.base.BaseReporter
,abc.ABC
Reporter that requires formatted fields.
- _abc_impl = <_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:
project_config.reporters.base.BaseFormattedReporter
Reporter that requires formatted fields without format.
- _abc_impl = <_abc_data object>
- errors: Dict[str, List[project_config.types.ErrorDict]]
- 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.ABC
Base reporter from which all reporters inherit.
- _abc_impl = <_abc_data object>
- exception_class
- 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.
- raise_errors() 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: project_config.types.ErrorDict) None [source]
Report an error.
- Parameters
error (dict) – Error to report.
- exception project_config.reporters.base.InvalidColors(errors: List[str])[source]
Bases:
project_config.exceptions.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.
- project_config.reporters.base.colored_color_exists(color: str) bool [source]
Check if a color exists in the colored library.
- project_config.reporters.base.self_format_noop(s, v)