-
Notifications
You must be signed in to change notification settings - Fork 132
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
Refactor: Remove file validation and add sample scripts #778
Conversation
@@ -367,8 +367,7 @@ export async function runScript( | |||
if (isJSONLFilename(outData)) await appendJSONL(outData, result.frames) | |||
else await writeText(outData, JSON.stringify(result.frames, null, 2)) | |||
|
|||
if (result.status === "success" && result.fileEdits && applyEdits) | |||
await writeFileEdits(result.fileEdits, { trace }) | |||
await writeFileEdits(result.fileEdits, { applyEdits, trace }) |
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.
The result.fileEdits
and applyEdits
are not checked before calling writeFileEdits
. This could lead to unexpected behavior if result.fileEdits
is undefined or applyEdits
is false.
generated by pr-review-commit
missing_check
packages/core/src/fileedits.ts
Outdated
// Iterate over each file edit entry | ||
for (const fileEdit of Object.entries(fileEdits || {})) { | ||
// Destructure the filename, before content, after content, and validation from the entry | ||
const [fn, { before, after, validation }] = fileEdit | ||
|
||
if (!applyEdits && !validation?.valid) { |
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.
The condition !applyEdits && !validation?.valid
will never be true because if applyEdits
is false, the function will not be called due to the missing check in run.ts
. This could lead to unexpected behavior.
generated by pr-review-commit
logic_error
// TODO: implement fibonacci algorithm | ||
return 0 // BODY | ||
} // this one needs to go | ||
// another comment |
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.
The function fibonacci
is not implemented and will always return 0. This could lead to incorrect results.
generated by pr-review-commit
unimplemented_code
This pull request removes the file validation logic that was previously responsible for checking file outputs against specified schemas and patterns. In its place, several sample scripts have been added to demonstrate functionality and provide a clearer structure for future development. The changes aim to simplify the codebase and enhance usability by focusing on practical examples.