fix: make Java init respect --yes flag for non-interactive mode#1952
fix: make Java init respect --yes flag for non-interactive mode#1952mashraf-222 wants to merge 1 commit intomainfrom
Conversation
The --yes CLI flag was defined but never consumed by init_java_project(). Thread non_interactive through main.py → init_codeflash() → init_java_project() so that when --yes is set, auto-detected defaults are used without prompts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @mashraf-222's task in 3m 3s —— View job PR Review Summary
Prek ChecksAll checks pass ( Code ReviewBehavior difference worth noting: In the interactive path, Minor: The core fix is correct: Duplicate DetectionNo duplicates detected. The Test CoverageBoth new tests pass. Tests correctly verify that:
|
Problem
codeflash init --yesfor Java projects still prompts interactively. The--yesflag is defined in the CLI argument parser (cli.py:502) but never consumed by any init function —init_java_project()always callsshould_modify_java_config()andcollect_java_setup_info()which useConfirm.ask()andinquirer.prompt().Root Cause
init_java_project()has nonon_interactiveparameter. The--yesflag fromparse_args()is never threaded throughmain.py→init_codeflash()→init_java_project().Fix
main.py: Passargs.yestoinit_codeflash(non_interactive=...)cmd_init.py: Threadnon_interactivetoinit_java_project()init_java.py: Whennon_interactive=True, skipshould_modify_java_config()andcollect_java_setup_info()(both interactive), useJavaSetupInfo()defaults (all auto-detected values)Validation
uv run pytest tests/test_init_java.py -v— 2 tests passTest Coverage
tests/test_init_java.py(new) —TestInitJavaNonInteractivewith 2 tests:test_non_interactive_skips_prompts_and_uses_auto_detected— verifies auto-detectedJavaSetupInfodefaultstest_non_interactive_skips_should_modify_check— verifiesshould_modify_java_configis not calledCloses CF-1086