devops.config.config_cpp

Module for parsing C++ configuration.

Functions

parse_cpp_config(raw_config)

Parse C++ configuration from a raw dictionary.

Classes

CppConfig([style_checks, ...])

Dataclass to hold C++ configuration values.

ForbiddenSpelling(replacement[, within_words])

A forbidden spelling's replacement and matching mode.

class devops.config.config_cpp.ForbiddenSpelling(replacement, within_words=False)[source]

Bases: object

A forbidden spelling’s replacement and matching mode.

Parameters:
  • replacement (str)

  • within_words (bool)

replacement: str
within_words: bool = False
class devops.config.config_cpp.CppConfig(style_checks=True, license_header_check=True, license_header=None, check_only_staged_files=False, check_dirs=<factory>, exclude_dirs=<factory>, header_guards_according_to_filepath=False, header_guard_pattern=None, ast_checks=True, ast_check_compile_args=<factory>, ast_check_compile_commands_db=None, ast_check_enabled_ids=<factory>, ast_check_disabled_ids=<factory>, ast_check_config=<factory>, forbidden_spellings=<factory>, incremental_state_file=None, fail_fast=True, parallel_jobs=1)[source]

Bases: object

Dataclass to hold C++ configuration values.

Parameters:
  • style_checks (bool)

  • license_header_check (bool)

  • license_header (str | None)

  • check_only_staged_files (bool)

  • check_dirs (list[str])

  • exclude_dirs (list[str])

  • header_guards_according_to_filepath (bool)

  • header_guard_pattern (str | None)

  • ast_checks (bool)

  • ast_check_compile_args (list[str])

  • ast_check_compile_commands_db (str | None)

  • ast_check_enabled_ids (list[str])

  • ast_check_disabled_ids (list[str])

  • ast_check_config (dict[str, dict])

  • forbidden_spellings (dict[str, ForbiddenSpelling])

  • incremental_state_file (str | None)

  • fail_fast (bool)

  • parallel_jobs (int)

style_checks: bool = True
license_header_check: bool = True
license_header: str | None = None
check_only_staged_files: bool = False
check_dirs: list[str]
exclude_dirs: list[str]
header_guards_according_to_filepath: bool = False
header_guard_pattern: str | None = None
ast_checks: bool = True
ast_check_compile_args: list[str]
ast_check_compile_commands_db: str | None = None
ast_check_enabled_ids: list[str]
ast_check_disabled_ids: list[str]
ast_check_config: dict[str, dict]
forbidden_spellings: dict[str, ForbiddenSpelling]
incremental_state_file: str | None = None
fail_fast: bool = True
parallel_jobs: int = 1
to_toml_lines()[source]

Convert the CppConfig to TOML lines.

Returns:

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

Return type:

list[str]

devops.config.config_cpp.parse_cpp_config(raw_config)[source]

Parse C++ configuration from a raw dictionary.

Parameters:

raw_config (dict) – The raw C++ configuration dictionary.

Returns:

CppConfig – The parsed CppConfig dataclass instance.

Return type:

CppConfig