scargo.commands package
Submodules
scargo.commands.build module
Build project bin/lib exec file
- scargo.commands.build.scargo_build(profile: str, target: Optional[ScargoTarget], all_targets: bool = False) None [source]
Build project exec file.
- Parameters
profile (str) – Profile
target – Target to build
all_targets (bool) – Build all targets
- Returns
None
scargo.commands.check module
Check written code with formatters
- class scargo.commands.check.CheckResult(problems_found, fix)[source]
Bases:
tuple
- fix: bool
Alias for field number 1
- problems_found: int
Alias for field number 0
- class scargo.commands.check.CheckerFixer(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
ABC
- can_fix = False
- abstract check_file(file_path: Path) CheckResult [source]
- check_name: str
- get_check_config() CheckConfig [source]
- headers_only = False
- class scargo.commands.check.ClangFormatChecker(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
CheckerFixer
- can_fix = True
- check_file(file_path: Path) CheckResult [source]
- check_name: str = 'clang-format'
- class scargo.commands.check.ClangTidyChecker(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
CheckerFixer
- build_path: Optional[Path] = None
- check_file(file_path: Path) CheckResult [source]
- check_name: str = 'clang-tidy'
- class scargo.commands.check.CopyrightChecker(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
CheckerFixer
- can_fix = True
- check_file(file_path: Path) CheckResult [source]
- check_name: str = 'copyright'
- class scargo.commands.check.CppcheckChecker(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
CheckerFixer
- check_file(file_path: Path) CheckResult [source]
- check_files() int [source]
Run cppcheck with the configured suppressions and directories and collect all issues.
- check_name: str = 'cppcheck'
- class scargo.commands.check.CyclomaticChecker(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
CheckerFixer
- check_file(file_path: Path) CheckResult [source]
- check_files() int [source]
Run lizard with the configured parameters and collect all cyclomatic complexity issues.
- check_name: str = 'cyclomatic'
- class scargo.commands.check.PragmaChecker(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
CheckerFixer
- can_fix = True
- check_file(file_path: Path) CheckResult [source]
- check_name: str = 'pragma'
- headers_only = True
- class scargo.commands.check.TodoChecker(config: Config, fix_errors: bool = False, verbose: bool = False)[source]
Bases:
CheckerFixer
- check_file(file_path: Path) CheckResult [source]
- check_name: str = 'todo'
- get_check_config() TodoCheckConfig [source]
- scargo.commands.check.find_files(dir_path: Path, glob_patterns: Sequence[str], exclude_patterns: Sequence[str]) Iterable[Path] [source]
- scargo.commands.check.scargo_check(clang_format: bool, clang_tidy: bool, copy_right: bool, cppcheck: bool, cyclomatic: bool, pragma: bool, todo: bool, verbose: bool) None [source]
Check written code using different formatters
- Parameters
clang_format (bool) – check clang_format
clang_tidy (bool) – check clang_tidy
copy_right (bool) – check copyrights
cppcheck (bool) – check cpp format
cyclomatic (bool) – check cyclomatic
pragma (bool) – check pragma
todo (bool) – check todo left in code
verbose (bool) – set verbose
- Returns
None
scargo.commands.clean module
Clean project from unnecessary files
- scargo.commands.clean.handle_item_deletion(item: Path) None [source]
Handle the deletion of a file or directory.
scargo.commands.debug module
- scargo.commands.debug.scargo_debug(bin_path: Optional[Path], target: Optional[ScargoTarget]) None [source]
scargo.commands.doc module
Create project documentation
scargo.commands.docker module
Handle docker for project
- scargo.commands.docker.get_docker_compose_command() List[str] [source]
Get docker command
- Returns
_description_
- Return type
List[str]
- scargo.commands.docker.scargo_docker_build(docker_opts: Sequence[str], project_root: Optional[Path] = None) None [source]
Build docker
- Parameters
docker_opts – additional docker options
project_root – scargo project root path
- Raises
CalledProcessError – if docker build fail
scargo.commands.fix module
Format project code using formatter
scargo.commands.flash module
- scargo.commands.flash.scargo_flash(flash_profile: str, port: Optional[str], target: Optional[ScargoTarget], app: bool, file_system: bool, erase_memory: bool, bank: Optional[int] = None) None [source]
scargo.commands.gen module
scargo.commands.monitor module
- class scargo.commands.monitor.CmdLoop(ser: Serial)[source]
Bases:
object
scargo.commands.new module
Create new project
- scargo.commands.new.get_build_env(create_docker: bool) str [source]
Get build env :param bool create_docker: if create docker :return: build env
- scargo.commands.new.process_chips(chips: List[str], targets: List[ScargoTarget]) Dict[str, str] [source]
- scargo.commands.new.scargo_new(name: str, bin_name: Optional[str], lib_name: Optional[str], targets: List[ScargoTarget], create_docker: bool, git: bool, chip: List[str]) None [source]
Create new project
- Parameters
name (str) – name of project
bin_name (Optional[str]) – name of bin file
lib_name (Optional[str]) – name of lib file
targets (List[Target]) – target types for a project
create_docker (bool) – initialize docker environment
git (bool) – initialize git repository
chip (List[str]) – list of chips for targets
- Returns
None
- Raises
FileExistsError – if project with provided name exist
scargo.commands.publish module
Publish conan package into repository
scargo.commands.run module
Run feature depending on provided args
- scargo.commands.run.scargo_run(bin_path: Optional[Path], profile: str, params: List[str], skip_build: bool) None [source]
Run command from CLI
- Parameters
bin_path (str) – path to bin file
profile (Path) – build profile name
params (str) – params for bin file
skip_build (bool) – skip build step
- Returns
None
scargo.commands.test module
Run test from project
scargo.commands.update module
Update project
scargo.commands.version module
feature function for scargo