|
| 1 | +# AI Agent Guidelines (AGENTS.md) |
| 2 | + |
| 3 | +This repository is a small Django test-runner package intended to make test output more human-friendly by highlighting the most relevant portions of tracebacks and messages. |
| 4 | + |
| 5 | +## Goals |
| 6 | + |
| 7 | +- Prefer small, focused changes. |
| 8 | +- Preserve existing behavior unless the task explicitly requires a behavior change. |
| 9 | +- Keep the library usable as a drop-in Django `TEST_RUNNER`. |
| 10 | + |
| 11 | +## Local setup |
| 12 | + |
| 13 | +- Use a virtual environment. |
| 14 | +- Install in editable mode for development: |
| 15 | + |
| 16 | +```bash |
| 17 | +python -m venv .venv |
| 18 | +. .venv/bin/activate |
| 19 | +python -m pip install -U pip |
| 20 | +python -m pip install -e . |
| 21 | +``` |
| 22 | + |
| 23 | +- Install Django appropriate to the change you’re making (this project historically targeted older Django, but modernization work may change that). |
| 24 | + |
| 25 | +## How to validate changes |
| 26 | + |
| 27 | +- Run any existing test/lint commands already present in the repo. |
| 28 | +- At minimum, ensure the code still imports and compiles: |
| 29 | + |
| 30 | +```bash |
| 31 | +python -m compileall rainbowtests setup.py |
| 32 | +``` |
| 33 | + |
| 34 | +- If you have a sample Django project handy, validate integration by setting: |
| 35 | + |
| 36 | +```python |
| 37 | +TEST_RUNNER = 'rainbowtests.test.runner.RainbowDiscoverRunner' |
| 38 | +``` |
| 39 | + |
| 40 | +…and running `python manage.py test`. |
| 41 | + |
| 42 | +## Code & style conventions |
| 43 | + |
| 44 | +- Do not do repo-wide reformatting unless explicitly requested. |
| 45 | +- Avoid adding new dependencies for minor changes. |
| 46 | +- Keep color/output behavior changes isolated to the existing modules (`rainbowtests/colors.py`, `rainbowtests/messages.py`, and `rainbowtests/test/*`) when possible. |
| 47 | + |
| 48 | +## Packaging / docs |
| 49 | + |
| 50 | +- Keep packaging metadata consistent with documentation files in the repo root (e.g., `README.md`, `LICENSE.md`). |
| 51 | +- Prefer Markdown for documentation. |
| 52 | + |
| 53 | +## Safety & privacy |
| 54 | + |
| 55 | +- Do not add secrets (API keys, tokens) to code, tests, docs, or CI. |
| 56 | +- Do not print environment variables or filesystem paths that could contain sensitive info. |
0 commit comments