scargo.utils package

Submodules

scargo.utils.clang_utils module

scargo.utils.clang_utils.get_comment_lines(file_path: Path) Iterable[Tuple[int, str]][source]

scargo.utils.conan_utils module

scargo.utils.conan_utils.conan_add_remote(project_path: Path, config: Config) None[source]

Add conan remote repository

Parameters
  • project_path (Path) – path to project

  • config (Config) –

Returns

None

scargo.utils.conan_utils.conan_remote_login(remote: str) None[source]

Add conan user

Parameters

remote (str) – name of remote repository

Returns

None

scargo.utils.conan_utils.conan_source(project_dir: Path) None[source]

scargo.utils.docker_utils module

scargo.utils.docker_utils.prepare_docker(project_config: ProjectConfig, project_path: Path) Dict[str, Any][source]
scargo.utils.docker_utils.run_command_in_docker(command: List[str], client: DockerClient, docker_tag: str, entrypoint: str, project_path: Path, path_in_docker: PurePosixPath) Dict[str, Any][source]
scargo.utils.docker_utils.run_scargo_again_in_docker(project_config: ProjectConfig, project_path: Path) None[source]

Run command in docker

Parameters
  • project_config (dict) – project configuration

  • project_path (Path) – path to project root

Returns

None

scargo.utils.file_utils module

scargo.utils.file_utils.extract_block_comments(content: str) List[str][source]

Extracts block comments from the given content.

Parameters

content – The string to extract comments from.

Returns

A list of block comments.

scargo.utils.file_utils.extract_comment_sections(file_path: Path) List[str][source]

Extracts comment sections from the given file.

Parameters

file_path – A Path object pointing to the file.

Returns

A list of comment sections.

scargo.utils.file_utils.extract_grouped_line_comments(content: str) List[str][source]

Extracts and groups line comments from the given content.

Parameters
  • content – The string to extract comments from.

  • pattern – The compiled regex pattern for line comments.

Returns

A list of grouped line comments.

scargo.utils.file_utils.finditer_with_line_numbers(pattern: Pattern, string: str, flags: int = 0) Iterable[Tuple[Match, int]][source]

Version of re.finditer that additionally returns the line number for each match.

Parameters
  • pattern – A compiled regular expression pattern.

  • string – The string to be searched.

  • flags – Standard re flags to modify the regex behavior

Yield

Tuples of (match object, line number), where line number is the line on which the match starts.

scargo.utils.path_utils module

scargo.utils.path_utils.get_config_file_path(config_file_name: str) Optional[Path][source]
scargo.utils.path_utils.get_project_root_or_none() Optional[Path][source]

scargo.utils.sys_utils module

scargo.utils.sys_utils.find_program_path(program_name: str) Path[source]

Module contents