Coverage for little_loops / cli / auto.py: 0%

22 statements  

« prev     ^ index     » next       coverage.py v7.12.0, created at 2026-03-14 23:20 -0500

1"""ll-auto: Process all backlog issues sequentially in priority order.""" 

2 

3from __future__ import annotations 

4 

5import argparse 

6from pathlib import Path 

7 

8from little_loops.cli.output import configure_output 

9from little_loops.cli_args import add_common_auto_args, parse_issue_ids, parse_issue_types 

10from little_loops.config import BRConfig 

11from little_loops.issue_manager import AutoManager 

12 

13 

14def main_auto() -> int: 

15 """Entry point for ll-auto command. 

16 

17 Process all backlog issues sequentially in priority order. 

18 

19 Returns: 

20 Exit code (0 = success) 

21 """ 

22 parser = argparse.ArgumentParser( 

23 description="Process all backlog issues sequentially in priority order", 

24 formatter_class=argparse.RawDescriptionHelpFormatter, 

25 epilog=""" 

26Examples: 

27 %(prog)s # Process all issues in priority order 

28 %(prog)s --max-issues 5 # Process at most 5 issues 

29 %(prog)s --resume # Resume from previous state 

30 %(prog)s --dry-run # Preview what would be processed 

31 %(prog)s --category bugs # Only process bugs 

32 %(prog)s --only BUG-001,BUG-002 # Process only specific issues 

33 %(prog)s --skip BUG-003 # Skip specific issues 

34 %(prog)s --type BUG # Process only bugs 

35 %(prog)s --type BUG,ENH # Process bugs and enhancements 

36""", 

37 ) 

38 

39 # Add common arguments from shared module 

40 add_common_auto_args(parser) 

41 

42 # Add tool-specific arguments 

43 parser.add_argument( 

44 "--category", 

45 "-c", 

46 type=str, 

47 default=None, 

48 help="Filter to specific category (bugs, features, enhancements)", 

49 ) 

50 

51 args = parser.parse_args() 

52 

53 project_root = args.config or Path.cwd() 

54 config = BRConfig(project_root) 

55 configure_output(config.cli) 

56 

57 if args.idle_timeout is not None: 

58 config.automation.idle_timeout_seconds = args.idle_timeout 

59 

60 # Parse issue ID filters 

61 only_ids = parse_issue_ids(args.only) 

62 skip_ids = parse_issue_ids(args.skip) 

63 type_prefixes = parse_issue_types(args.type) 

64 

65 manager = AutoManager( 

66 config=config, 

67 dry_run=args.dry_run, 

68 max_issues=args.max_issues, 

69 resume=args.resume, 

70 category=args.category, 

71 only_ids=only_ids, 

72 skip_ids=skip_ids, 

73 type_prefixes=type_prefixes, 

74 verbose=not args.quiet, 

75 ) 

76 

77 return manager.run()