Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Doc: Fix issues with trailing spaces in CL examples (#900)

Kilian Lieret6d7e5ae64924
diff --git a/docs/assets/js/sh-annotation.js b/docs/assets/js/sh-annotation.js
new file mode 100644
index 00000000..0e2e0ae7
--- /dev/null
+++ b/docs/assets/js/sh-annotation.js
@@ -0,0 +1,11 @@
+// Source: https://github.com/srl-labs/learn-srlinux/pull/133/files
+// this script is used to remove extra leading space when annotating shell code blocks ending with `\`
+// character. See https://github.com/squidfunk/mkdocs-material/issues/3846 for more info.
+document$.subscribe(() => {
+ const tags = document.querySelectorAll("code .se");
+ tags.forEach((tag) => {
+ if (tag.innerText.startsWith("\\")) {
+ tag.innerText = "\\";
+ }
+ });
+});
diff --git a/docs/usage/cl_tutorial.md b/docs/usage/cl_tutorial.md
index b3c4b900..e9a2c50f 100644
--- a/docs/usage/cl_tutorial.md
+++ b/docs/usage/cl_tutorial.md
@@ -15,7 +15,7 @@ Before we start with a more structured explanation of the command line options,
```bash title="Fix a github issue"
python run.py \
--agent.model.name=gpt4 \
- --agent.model.per_instance_cost_limit=2.00 \ # (1)!
+ --agent.model.per_instance_cost_limit=2.00 \
--env.repo.github_url=https://github.com/SWE-agent/test-repo \
--problem_statement.github_url=https://github.com/SWE-agent/test-repo/issues/1
```
diff --git a/docs/usage/hello_world.md b/docs/usage/hello_world.md
index 31244033..dc4c586e 100644
--- a/docs/usage/hello_world.md
+++ b/docs/usage/hello_world.md
@@ -20,14 +20,14 @@ Let's start with an absolutely trivial example and solve an issue about a simple
```bash
sweagent run \
- --agent.model.name=claude-3-5-sonnet-20241022 \ # (1)!
- --agent.model.per_instance_cost_limit=2.00 \ # (2)!
+ --agent.model.name=claude-3-5-sonnet-20241022 \ # (1)!
+ --agent.model.per_instance_cost_limit=2.00 \ # (2)!
--env.repo.github_url=https://github.com/SWE-agent/test-repo \
--problem_statement.github_url=https://github.com/SWE-agent/test-repo/issues/1
```
1. We recommend either `Claude 3.5 Sonnet` or `GPT-4o` for this tutorial.
-2. This limits the inference cost per instance to $2. The default is $3.
+2. This limits the inference cost per instance (per solved problem) to $2. The default is $3.
!!! tip "Annotations"
Notice the :material-chevron-right-circle: icon in the right margin in the code snippet? Click on it to display more information
diff --git a/mkdocs.yml b/mkdocs.yml
index 049f90a7..a09a9203 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -144,6 +144,8 @@ plugins:
repo_url: https://github.com/SWE-agent/SWE-agent
repo_name: SWE-agent/SWE-agent
edit_uri: edit/main/docs/
+extra_javascript:
+ - assets/js/sh-annotation.js
extra_css:
- assets/custom.css
- assets/mkdocstrings.css