Skip to content

Commit

Permalink
fix: use a list for todo so that padding fix doesn't break openai (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevyor authored Apr 10, 2024
1 parent 0c7e8ab commit a592b9e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .grit/patterns/python/py_todo.grit
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ function todo($target, $message) {
$message = "This requires manual intervention."
},
$lines = lines(string = $message),
$result = [],
$lines <: some bubble($result) $x where {
if ($result <: undefined) {
$result = `# TODO: $x`
if ($result <: []) {
$result += `# TODO: $x`
} else {
$result += `\n# $x`
$result += `# $x`
}
},
$log_message = `TODO: $message`,
log(message=$log_message, variable=$target),
$lines = lines(string = $target),
$lines <: some bubble($result) $x where { $result += `\n# $x` },
$lines <: some bubble($result) $x where { $result += `# $x` },
$result = join(list=$result, separator=`\n`),
return $result,
}

0 comments on commit a592b9e

Please sign in to comment.