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]

Add dev notes (#415)

Kilian Lieretfff654cde77d
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
new file mode 100644
index 00000000..17fb467c
--- /dev/null
+++ b/docs/CONTRIBUTING.md
@@ -0,0 +1,16 @@
+# Contribution guidelines
+
+<!-- Please don't use relative links in this page, as it is included by github in various places -->
+<!-- INCLUSION START -->
+
+The easiest way to contribute is to give us feedback.
+
+* **Something isn't working?** Open a [bug report](https://github.com/princeton-nlp/SWE-agent/issues/new?template=bug_report.yml).
+ Rule of thumb: If you're running something and you get some error messages, this is the issue type for you.
+* **You have a concrete question?** Open a [question issue](https://github.com/princeton-nlp/SWE-agent/issues/new?template=question.yml).
+* **You are missing something?** Open a [feature request issue](https://github.com/princeton-nlp/SWE-agent/issues/new?template=feature_request.yml)
+* **Open-ended discussion?** Talk on [discord](https://discord.gg/AVEFbBn2rH). Note that all actionable items should be an issue though.
+
+<!-- INCLUSION END -->
+
+You want to do contribute to the development? Great! Please see the [development guidelines](https://princeton-nlp.github.io/SWE-agent/dev/contribute/) for guidelines and tips.
\ No newline at end of file
diff --git a/docs/dev/contribute.md b/docs/dev/contribute.md
index e69de29b..1efe935b 100644
--- a/docs/dev/contribute.md
+++ b/docs/dev/contribute.md
@@ -0,0 +1,51 @@
+# Contribute to SWE-agent
+
+{%
+ include-markdown "../CONTRIBUTING.md"
+ start="<!-- INCLUSION START -->"
+ end="<!-- INCLUSION END -->"
+%}
+
+Wanna do more and actually contribute code? Great! Please see the following sections for tips and guidelines!
+
+## Development repository set-up
+
+Please install the repository from source, following our [usual instructions](../installation/source.md) but add the `[dev]` option to the `pip` command (you can just run the command again):
+
+```bash
+pip install -e '.[dev]'
+```
+
+Then, make sure to set up [`pre-commit`](https://pre-commit.com):
+
+```bash
+# cd to our repo root
+pre-commit install
+```
+
+`pre-commit` will check for formatting and basic syntax errors before your commits.
+
+Some issues can be automatically fixed with [`ruff`](https://github.com/charliermarsh/ruff) (part of the checks):
+
+```bash
+pipx run ruff check --fix
+```
+
+## Tips for pull requests
+
+* Please open separate PRs for separate issues. This makes it easier to incorporate part of your changes.
+* It might be good to open an issue and discuss first before investing time on an experimental feature.
+* When changing the behavior of the agent, we need to have some indication that it actually improves the success rate of SWE-agent.
+ However, if you make the behavior optional without complicating SWE-agent (for example by providing new [commands](../config/commands.md)),
+ we might be less strict.
+
+## Building the documentation
+
+Simply run
+
+```bash
+# cd repo root
+mkdocs serve
+```
+
+and point your browser to port 8000 or click one of the links in the output.
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index d36e81f1..789f8a77 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -44,6 +44,7 @@ dev = [
"pytest",
"pytest-cov",
"pipx",
+ "pre-commit",
]
[tool.setuptools]