[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/aidermacs 3d4919292e 139/466: Feat: Basic support for Test
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/aidermacs 3d4919292e 139/466: Feat: Basic support for Test Driven Development (TDD) (#29) |
Date: |
Sat, 15 Mar 2025 19:12:55 -0400 (EDT) |
branch: elpa/aidermacs
commit 3d4919292e3cd83a67ab0b0383e8dca8e6813b0e
Author: Kang Tu <tninja@gmail.com>
Commit: GitHub <noreply@github.com>
Feat: Basic support for Test Driven Development (TDD) (#29)
* feat: Add aider-fix-failing-test function for test debugging and repair
* refactor: Update test failure handling to use /architect command
* feat: Rename aider-fix-failing-test function and menu entry for clarity
* docs(readme): update test-driven development section
* docs(helm): add description of history prompt fuzzy search
* docs: improve helm description in readme
---
README.org | 7 ++++++-
aider.el | 19 ++++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/README.org b/README.org
index 9bc7a5839a..b028e6b288 100644
--- a/README.org
+++ b/README.org
@@ -29,6 +29,9 @@
- Explain: (`aider-region-explain`): Select a region (e.g., a code block) in
a file and ask Aider to explain it.
- Refactor: (`aider-region-refactor`): Ask Aider to refactor it given your
input instruction.
+- Support for Test Driven Development:
+ - Fix Tests: (`aider-fix-failing-test-under-cursor`): Place cursor on a
failing test function and ask Aider to analyze and fix the code to make tests
pass.
+
- And More: Add your own Elisp functions to support your use case. You can
certainly ask Aider / `aider.el` to do that.
* Installation
@@ -79,7 +82,9 @@ The aider prefix is "A".
** Optional
-*** Optional Helm Support
+*** Helm Support
+
+Helm enables fuzzy searching functionality for command history prompts
You can enable Helm-based completion in two ways:
diff --git a/aider.el b/aider.el
index d312a2b0fd..56c49a8861 100644
--- a/aider.el
+++ b/aider.el
@@ -77,8 +77,9 @@ This function can be customized or redefined by the user."
["Code Change"
("c" "Code Change" aider-code-change)
("t" "Architect Discuss and Change" aider-architect-discussion)
- ("R" "Refactor Function Under Cursor" aider-function-refactor)
("r" "Refactor Code in Selected Region" aider-region-refactor)
+ ("R" "Refactor Function Under Cursor" aider-function-refactor)
+ ("T" "Fix Failing Test Under Cursor" aider-fix-failing-test-under-cursor)
("m" "Show Last Commit with Magit" aider-magit-show-last-commit)
("u" "Undo Last Change" aider-undo-last-change)
]
@@ -423,6 +424,22 @@ The command will be formatted as \"/ask \" followed by the
text from the selecte
(let ((repo-path (string-trim git-repo-path)))
(dired-other-window repo-path)))))
+;;; functions for test fixing
+
+;;;###autoload
+(defun aider-fix-failing-test-under-cursor ()
+ "Report the current test failure to aider and ask it to fix the code.
+This function assumes the cursor is on or inside a test function."
+ (interactive)
+ (if-let ((test-function-name (which-function)))
+ (let* ((initial-input (format "The test '%s' is failing. Please analyze
and fix the code to make the test pass. Don't break any other test"
+ test-function-name))
+ (test-output (aider-read-string "Architect question: "
initial-input))
+ (command (format "/architect %s" test-output)))
+ (aider-add-current-file)
+ (aider--send-command command t))
+ (message "No test function found at cursor position.")))
+
;;; functions for .aider file related
;; New function to send "<line under cursor>" to the Aider buffer
- [nongnu] elpa/aidermacs 8a039d5137 082/466: Merge pull request #5 from AmaiKinono/custom-aider-program, (continued)
- [nongnu] elpa/aidermacs 8a039d5137 082/466: Merge pull request #5 from AmaiKinono/custom-aider-program, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs e0e77f3874 090/466: add aider-send-line-under-cursor, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs c57f083466 097/466: feat: add interactive function to run find-name-dired from Git repository root, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 9fc3b04775 099/466: Feat: Git repo find / mark / add files, and buffer send command for .aider file (#7), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs a181be69c6 102/466: update place to invoke aider--send-command. remove dup, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs dbcc393ba0 105/466: Feat: aider-minor-mode (#10), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 0cb131bd9e 107/466: feat: Add function to add files in current window to Aider buffer, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs b3450f17b0 112/466: Merge branch 'main' of github.com:tninja/aider.el, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs e391bbe222 113/466: Feat: Add function to explain code in selected region, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 134c626bc3 117/466: feat: Add option for Architect Discuss and Change in code change menu, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 3d4919292e 139/466: Feat: Basic support for Test Driven Development (TDD) (#29),
ELPA Syncer <=
- [nongnu] elpa/aidermacs 7f3601920b 140/466: Feat: Add two code reading helper functions (#30), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs d60824add8 142/466: Refactor: combine function under cursor function and region based function as single one (#34), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 257fe7e8f0 152/466: docs: improve README.org organization with clear sections, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 5e71503bc8 161/466: refactor: Update aider--escape-string-for-aider to handle multiline strings with special markers, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 19e04225f3 206/466: Merge pull request #74 from tninja/kang_feat_2, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs f90000ca14 211/466: Fix: Handle the case when the current buffer file is not in a git repo (#79), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs ebe03e12c0 208/466: docs(readme): reorganize sections for better readability, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs d8c04645fe 217/466: Merge pull request #82 from tninja/kang_feat_2, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 1019607088 093/466: make switch buffer shortcut for aider-mode, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs f83fb13a0f 225/466: Introduce Aidermacs, ELPA Syncer, 2025/03/15