Coverage for /Users/les/Projects/crackerjack/crackerjack/models/protocols.py: 0%

51 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-09-03 15:39 -0700

1import subprocess 

2import typing as t 

3 

4 

5@t.runtime_checkable 

6class CommandRunner(t.Protocol): 

7 def execute_command( 

8 self, 

9 cmd: list[str], 

10 **kwargs: t.Any, 

11 ) -> subprocess.CompletedProcess[str]: ... 

12 

13 

14@t.runtime_checkable 

15class OptionsProtocol(t.Protocol): 

16 commit: bool 

17 interactive: bool 

18 no_config_updates: bool 

19 verbose: bool 

20 clean: bool 

21 test: bool 

22 benchmark: bool 

23 test_workers: int = 0 

24 test_timeout: int = 0 

25 publish: t.Any | None 

26 bump: t.Any | None 

27 all: t.Any | None 

28 ai_agent: bool = False 

29 start_mcp_server: bool = False 

30 create_pr: bool = False 

31 skip_hooks: bool = False 

32 update_precommit: bool = False 

33 async_mode: bool = False 

34 experimental_hooks: bool = False 

35 enable_pyrefly: bool = False 

36 enable_ty: bool = False 

37 cleanup: t.Any | None = None 

38 no_git_tags: bool = False 

39 skip_version_check: bool = False 

40 cleanup_pypi: bool = False 

41 coverage: bool = False 

42 keep_releases: int = 10 

43 track_progress: bool = False 

44 fast: bool = False 

45 comp: bool = False 

46 enterprise_batch: str | None = None 

47 monitor_dashboard: str | None = None 

48 coverage: bool = False 

49 

50 

51@t.runtime_checkable 

52class ConsoleInterface(t.Protocol): 

53 def print(self, *args: t.Any, **kwargs: t.Any) -> None: ... 

54 

55 def input(self, _: str = "") -> str: ... 

56 

57 

58@t.runtime_checkable 

59class FileSystemInterface(t.Protocol): 

60 def read_file(self, path: str | t.Any) -> str: ... 

61 

62 def write_file(self, path: str | t.Any, content: str) -> None: ... 

63 

64 def exists(self, path: str | t.Any) -> bool: ... 

65 

66 def mkdir(self, path: str | t.Any, parents: bool = False) -> None: ... 

67 

68 

69@t.runtime_checkable 

70class GitInterface(t.Protocol): 

71 def is_git_repo(self) -> bool: ... 

72 

73 def get_changed_files(self) -> list[str]: ... 

74 

75 def commit(self, message: str) -> bool: ... 

76 

77 def push(self) -> bool: ... 

78 

79 def add_files(self, files: list[str]) -> bool: ... 

80 

81 def get_commit_message_suggestions(self, changed_files: list[str]) -> list[str]: ... 

82 

83 

84@t.runtime_checkable 

85class HookManager(t.Protocol): 

86 def run_fast_hooks(self) -> list[t.Any]: ... 

87 

88 def run_comprehensive_hooks(self) -> list[t.Any]: ... 

89 

90 def install_hooks(self) -> bool: ... 

91 

92 def set_config_path(self, path: str | t.Any) -> None: ... 

93 

94 def get_hook_summary(self, results: t.Any) -> t.Any: ... 

95 

96 

97@t.runtime_checkable 

98class TestManagerProtocol(t.Protocol): 

99 def run_tests(self, options: OptionsProtocol) -> bool: ... 

100 

101 def get_coverage(self) -> dict[str, t.Any]: ... 

102 

103 def validate_test_environment(self) -> bool: ... 

104 

105 def get_test_failures(self) -> list[str]: ... 

106 

107 

108@t.runtime_checkable 

109class PublishManager(t.Protocol): 

110 def bump_version(self, version_type: str) -> str: ... 

111 

112 def publish_package(self) -> bool: ... 

113 

114 def validate_auth(self) -> bool: ... 

115 

116 def create_git_tag(self, version: str) -> bool: ... 

117 

118 def cleanup_old_releases(self, keep_releases: int) -> None: ...