Coverage for src / rhiza / commands / __init__.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2025-12-29 01:59 +0000

1"""Command implementations for the Rhiza CLI. 

2 

3This package contains the core implementation functions that back the Typer 

4commands exposed by `rhiza.cli`. These commands help you manage reusable 

5configuration templates for Python projects. 

6 

7## Available Commands 

8 

9### init 

10 

11Initialize or validate `.github/rhiza/template.yml` in a target directory. 

12 

13Creates a default configuration file if it doesn't exist, or validates 

14an existing one. The default configuration includes common Python project 

15files like `.github`, `.editorconfig`, `.gitignore`, 

16`.pre-commit-config.yaml`, `Makefile`, and `pytest.ini`. 

17 

18### materialize 

19 

20Inject Rhiza configuration templates into a target repository. 

21 

22Materializes template files from the configured template repository into 

23your target project by performing a sparse clone of the template repository, 

24copying specified files/directories, and respecting exclusion patterns. 

25Files that already exist will not be overwritten unless the `--force` flag 

26is used. 

27 

28### validate 

29 

30Validate Rhiza template configuration. 

31 

32Validates the `.github/rhiza/template.yml` file to ensure it is syntactically 

33correct and semantically valid. Performs comprehensive validation including 

34YAML syntax checking, required field verification, field type validation, 

35and repository format verification. 

36 

37## Usage Example 

38 

39These functions are typically invoked through the CLI: 

40 

41 ```bash 

42 $ rhiza init # Initialize configuration 

43 

44 $ rhiza materialize # Apply templates to project 

45 

46 $ rhiza validate # Validate template configuration 

47 ``` 

48 

49For more detailed usage examples and workflows, see the USAGE.md guide 

50or try rhiza <command> --help 

51""" 

52 

53from .init import init # noqa: F401 

54from .materialize import materialize # noqa: F401 

55from .validate import validate # noqa: F401