From 74510bfb97c9f8d8152c6a59df0f6d0755f40418 Mon Sep 17 00:00:00 2001 From: jovnc <95868357+jovnc@users.noreply.github.com> Date: Mon, 26 Jan 2026 21:58:09 +0800 Subject: [PATCH 1/2] Add AGENTS.md file --- AGENTS.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..aa2401b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,32 @@ +# AGENTS.md + +Python library for autograding Git repositories, used by Git Mastery exercise repository to verify exercise solutions. + +## Dev environment + +- Python 3.13+ +- Install dependencies: `pip install -r requirements.txt` +- Install package in dev mode: `pip install -e .` + +## Testing + +- Run tests: `python -m pytest -s -vv` +- Tests are located in `tests/` + +## Project structure + +- `src/git_autograder/` - Main package + - `repo/` - Repository handling (GitAutograderRepo) + - `branch.py`, `commit.py`, `remote.py` - Git object wrappers + - `exercise.py` - Exercise configuration and grading + - `helpers/` - Utility functions +- `docs/` - Sphinx documentation + +## Code style + +- **Type hints**: Required on all function signatures. Use `Optional[T]` for nullable types, union syntax `A | B` for alternatives +- **Docstrings**: Use reStructuredText format with `:param:` and `:type:` tags for public APIs +- **Imports**: Group in order: stdlib → third-party → local. Use absolute imports from `git_autograder` +- **Naming**: Classes use `GitAutograder` prefix (e.g., `GitAutograderRepo`). Private methods use single underscore prefix +- **Exceptions**: Raise `GitAutograderInvalidStateException` for invalid states, `GitAutograderWrongAnswerException` for grading failures +- **Dataclasses**: Prefer `@dataclass` for simple data containers From f5a93e36c4196fa87573475a1227d376e5d57388 Mon Sep 17 00:00:00 2001 From: jovnc <95868357+jovnc@users.noreply.github.com> Date: Sun, 1 Feb 2026 23:00:40 +0800 Subject: [PATCH 2/2] Update AGENTS.md --- AGENTS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index aa2401b..b42171c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,8 @@ Python library for autograding Git repositories, used by Git Mastery exercise re - `branch.py`, `commit.py`, `remote.py` - Git object wrappers - `exercise.py` - Exercise configuration and grading - `helpers/` - Utility functions -- `docs/` - Sphinx documentation +- `docs/` - Documentation +- `tests/` - Test suite ## Code style