devops.config.config

Module for reading and parsing configuration files.

Functions

init_config()

Initialize global config paths.

parse_config(raw)

Parse a raw configuration dictionary into a GlobalConfig object.

read_config([path])

Read and parse a TOML configuration file into a GlobalConfig object.

Classes

ExcludeConfig([buggy_cpp_macros])

Dataclass to hold default exclusion values.

GlobalConfig([exclude, logging, git, cpp, file])

Dataclass to hold default configuration values.

class devops.config.config.ExcludeConfig(buggy_cpp_macros=<factory>)[source]

Bases: object

Dataclass to hold default exclusion values.

Parameters:

buggy_cpp_macros (list[str])

buggy_cpp_macros: list[str]
to_toml_lines()[source]

Convert the ExcludeConfig to TOML lines.

Returns:

list[str] – The list of TOML lines representing the configuration.

Return type:

list[str]

class devops.config.config.GlobalConfig(exclude=<factory>, logging=<factory>, git=<factory>, cpp=<factory>, file=<factory>)[source]

Bases: object

Dataclass to hold default configuration values.

Parameters:
exclude: ExcludeConfig
logging: LoggingConfig
git: GitConfig
cpp: CppConfig
file: FileConfig
write_default()[source]

Write the current configuration to a TOML file.

Parameters:

path (str | Path) – The path to the output TOML file.

Return type:

None

devops.config.config.parse_config(raw)[source]

Parse a raw configuration dictionary into a GlobalConfig object.

Parameters:

raw (dict[str, Any]) – The raw configuration dictionary.

Returns:

GlobalConfig – The parsed GlobalConfig object.

Return type:

GlobalConfig

devops.config.config.read_config(path=None)[source]

Read and parse a TOML configuration file into a GlobalConfig object.

Parameters:

path (str | Path | None) – The path to the TOML configuration file. If None, defaults to the general default config

Returns:

GlobalConfig – The parsed GlobalConfig object.

Return type:

GlobalConfig

devops.config.config.init_config()[source]

Initialize global config paths.

Returns:

GlobalConfig – The initialized global configuration object.

Return type:

GlobalConfig