Skip to content

Commit 77656fa

Browse files
Bruce Haumanclaude
andcommitted
Rename dry-run parameter to dry_run for consistency
- Change parameter name from dry-run to dry_run (with underscore) - Update all references in file_edit and form_edit tools - Fix key mismatch in validate-inputs return map 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 00738aa commit 77656fa

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/clojure_mcp/tools/file_edit/pipeline.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@
124124
125125
Returns:
126126
- A context map with the result of the operation"
127-
[file-path old-string new-string dry-run {:keys [nrepl-client-atom] :as config}]
127+
[file-path old-string new-string dry_run {:keys [nrepl-client-atom] :as config}]
128128
(let [initial-ctx {::form-pipeline/file-path file-path
129129
::old-string old-string
130130
::new-string new-string
131-
::dry-run dry-run
131+
::dry-run dry_run
132132
::form-pipeline/nrepl-client-atom nrepl-client-atom
133133
::form-pipeline/config config}]
134134
;; Pipeline for existing file edit
@@ -172,19 +172,19 @@
172172
(if (::form-pipeline/error ctx)
173173
{:error true
174174
:message (::form-pipeline/message ctx)}
175-
(let [dry-run (::dry-run ctx)]
175+
(let [dry_run (::dry-run ctx)]
176176
(cond-> {:error false
177177
:type (::form-pipeline/type ctx)}
178178
;; Include repaired flag if present
179179
(::form-pipeline/repaired ctx)
180180
(assoc :repaired true)
181181

182182
;; Return new-source if dry-run is "new-source"
183-
(= dry-run "new-source")
183+
(= dry_run "new-source")
184184
(assoc :new-source (::form-pipeline/output-source ctx))
185185

186186
;; Otherwise return diff (default behavior and for "diff" dry-run)
187-
(not= dry-run "new-source")
187+
(not= dry_run "new-source")
188188
(assoc :diff (::form-pipeline/diff ctx))))))
189189

190190
(comment

src/clojure_mcp/tools/file_edit/tool.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ To make a file edit, provide the file_path, old_string (the text to replace), an
8181
:new_string new_string))))
8282

8383
(defmethod tool-system/execute-tool :file-edit [{:keys [nrepl-client-atom] :as tool} inputs]
84-
(let [{:keys [file_path old_string new_string dry-run]} inputs
85-
result (pipeline/file-edit-pipeline file_path old_string new_string dry-run tool)]
84+
(let [{:keys [file_path old_string new_string dry_run]} inputs
85+
result (pipeline/file-edit-pipeline file_path old_string new_string dry_run tool)]
8686
(pipeline/format-result result)))
8787

8888
(defmethod tool-system/format-results :file-edit [_ {:keys [error message diff new-source type repaired]}]

src/clojure_mcp/tools/form_edit/combined_edit_tool.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Note: For `defmethod` forms, be sure to include the dispatch value (`area :recta
126126
;; Validate inputs implementation
127127
(defmethod tool-system/validate-inputs :clojure-edit-form [{:keys [nrepl-client-atom]} inputs]
128128
(let [file-path (validate-file-path inputs nrepl-client-atom)
129-
{:keys [form_identifier form_type operation content dry-run]} inputs
129+
{:keys [form_identifier form_type operation content dry_run]} inputs
130130
form_name form_identifier]
131131
(when-not form_identifier
132132
(throw (ex-info "Missing required parameter: form_identifier"
@@ -149,16 +149,16 @@ Note: For `defmethod` forms, be sure to include the dispatch value (`area :recta
149149
:form_type form_type
150150
:operation operation
151151
:content content
152-
:dry-run dry-run}))
152+
:dry_run dry_run}))
153153

154154
;; Execute tool implementation
155155
(defmethod tool-system/execute-tool :clojure-edit-form [{:keys [nrepl-client-atom] :as tool} inputs]
156-
(let [{:keys [file_path form_name form_type operation content dry-run]} inputs
156+
(let [{:keys [file_path form_name form_type operation content dry_run]} inputs
157157
edit-type (case operation
158158
"replace" :replace
159159
"insert_before" :before
160160
"insert_after" :after)
161-
result (pipeline/edit-form-pipeline file_path form_name form_type content edit-type dry-run tool)
161+
result (pipeline/edit-form-pipeline file_path form_name form_type content edit-type dry_run tool)
162162
formatted-result (pipeline/format-result result)]
163163
formatted-result))
164164

src/clojure_mcp/tools/form_edit/pipeline.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,21 +542,21 @@
542542
(if (::error ctx)
543543
{:error true
544544
:message (::message ctx)}
545-
(let [dry-run (::dry-run ctx)
545+
(let [dry_run (::dry-run ctx)
546546
result-map {:error false}]
547547
(cond-> result-map
548548
(::offsets ctx) (assoc :offsets (::offsets ctx))
549549

550550
;; Return new-source if dry-run is "new-source"
551-
(= dry-run "new-source")
551+
(= dry_run "new-source")
552552
(assoc :new-source (::output-source ctx))
553553

554554
;; Otherwise return diff (default behavior and for "diff" dry-run)
555-
(and (::diff ctx) (not= dry-run "new-source"))
555+
(and (::diff ctx) (not= dry_run "new-source"))
556556
(assoc :diff (::diff ctx))
557557

558558
;; Legacy: include :result if output-source exists
559-
(and (::output-source ctx) (not dry-run))
559+
(and (::output-source ctx) (not dry_run))
560560
(assoc :result [(::output-source ctx)])))))
561561

562562
;; Pipeline function definitions
@@ -574,13 +574,13 @@
574574
- config: Optional tool configuration map with :nrepl-client-atom
575575
576576
Returns a context map with the result of the operation"
577-
[file-path form-name form-type content-str edit-type dry-run {:keys [nrepl-client-atom] :as config}]
577+
[file-path form-name form-type content-str edit-type dry_run {:keys [nrepl-client-atom] :as config}]
578578
(let [ctx {::file-path file-path
579579
::top-level-def-name form-name
580580
::top-level-def-type form-type
581581
::new-source-code content-str
582582
::edit-type edit-type
583-
::dry-run dry-run
583+
::dry-run dry_run
584584
::nrepl-client-atom nrepl-client-atom
585585
::config config}]
586586
(thread-ctx

0 commit comments

Comments
 (0)