Skip to content

Commit e976613

Browse files
Allow non-zero exit-codes
* add this to the tool definition for now
1 parent d79bfa3 commit e976613

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

prompts/pylint/1-generate-violations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
tools:
33
- name: pylint
4+
check-exit-code: false
45
---
56

67
# Pylint

src/prompts.clj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,14 @@
229229
(when user {:user user})
230230
(when pat {:pat pat})
231231
(when timeout {:timeout timeout}))
232-
{:keys [pty-output exit-code done] :as result} (docker/run-function function-call)]
232+
{:keys [pty-output exit-code done] :as result} (docker/run-function function-call)
233+
exit-code-fail? (if (false? (:exit-code definition))
234+
false
235+
(not= 0 exit-code))]
233236
(cond
234-
(and (= :exited done) (= 0 exit-code))
237+
(and (= :exited done) (not exit-code-fail?))
235238
(resolve pty-output)
236-
(and (= :exited done) (not= 0 exit-code))
239+
(and (= :exited done) exit-code-fail?)
237240
(fail (format "call exited with non-zero code (%d): %s" exit-code pty-output))
238241
(= :timeout done)
239242
(fail (format "call timed out: %s" (:timeout result)))

0 commit comments

Comments
 (0)