We welcome contributions to JailbreakBench! Feel free to open an issue or a pull request for new contribution.

In this project we use [rye](https://rye-up.com/). You can install it via:

```bash
curl -sSf https://rye-up.com/get | bash
```

Or follow the official instructions [here](https://rye-up.com/guide/installation/).

If you don't want to install rye, then you can install the dependencies in your virtual environment by installing the dev dependencies in editable mode via:

```bash
pip install -r requirements-dev.txt && pip install -e .
```

Once you are done with the changes, please make sure to run the tests and the linters. If you use rye, it's as easy as running:

```bash
rye fmt
rye lint --fix
rye run mypy .
rye test
```

Otherwise, you'll have to run the commands manually.

1. You can run `ruff` to lint and format the codebase. In particular, run:

```bash
ruff --fix . && ruff format .
```

2. Typecheck the code via `mypy` by running the following command:

```bash
mypy .
```

3. Finally, please run the tests using `unittest`:

```bash
python -m pytest
```
