-
Notifications
You must be signed in to change notification settings - Fork 0
fix(autoFIPC): restrict interactive choices to documented values #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
b2332d3
88be87b
06d9108
64e0211
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,3 +24,6 @@ | |
| ^\.jules(/.*)?$ | ||
| ^\.trivyignore\.yaml$ | ||
| ^trivy\.yaml$ | ||
| ^\.semgrepignore$ | ||
| ^test_dummy\.R$ | ||
| ^test_validation\.R$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,7 @@ autoFIPC <- | |
| } | ||
| for (attempt in seq_len(3)) { | ||
| n <- readline(prompt = "Is it correct? (1: Yes 2: No) : ") | ||
| if (grepl("^[0-9]+$", n)) { | ||
| if (grepl("^[12]$", n)) { | ||
| return(as.integer(n)) | ||
|
Comment on lines
+144
to
145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Stricter prompt regex changes retry behavior With Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| } | ||
| } | ||
|
|
@@ -171,7 +171,7 @@ autoFIPC <- | |
| readline( | ||
| prompt = "Do you want to use default BILOG-MG priors for oldform Data? (1: Yes 2: No) : " | ||
| ) | ||
| if (grepl("^[0-9]+$", n)) { | ||
| if (grepl("^[12]$", n)) { | ||
| return(as.integer(n)) | ||
| } | ||
| } | ||
|
|
@@ -390,7 +390,7 @@ autoFIPC <- | |
| readline( | ||
| prompt = "Do you want to use default BILOG-MG priors for newform Data? (1: Yes 2: No) : " | ||
| ) | ||
| if (grepl("^[0-9]+$", n)) { | ||
| if (grepl("^[12]$", n)) { | ||
| return(as.integer(n)) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
변경된 입력 경로에 회귀 테스트를 추가하세요.
이 변경은 세 프롬프트의 허용 입력을 변경합니다. 각 경로에서
1과2를 허용하고0,3,01, 공백 포함 입력, 매우 긴 숫자 문자열을 거부하는 테스트 또는 fixture를 추가하세요. 제공된tests/testthat/test-autoFIPC.R:1-12는 비대화형 오류만 확인하므로 변경된readline()경로를 검증하지 않습니다.As per coding guidelines:
**/*: Add tests/fixtures first when behavior changes are required.Also applies to: 174-174, 393-393
🤖 Prompt for AI Agents
Source: Coding guidelines