scm-platform/AGENTS.md at main · getsentry/scm-platform · GitHub
Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.63 KB

AGENTS.md

File metadata and controls

34 lines (28 loc) · 1.63 KB

Repository agent conventions

When changing the provider protocol (src/scm/types.py)

If you add a new provider protocol/method, or add or change a parameter on an existing method in CreateCommitProtocol or any other provider protocol, you MUST update all of the following surfaces so the abstraction stays symmetric across providers and tools:

  1. src/scm/actions.py — forward the parameter through the action wrapper.
  2. src/scm/providers/github/provider.py — GitHub implementation.
  3. src/scm/providers/gitlab/provider.py — GitLab implementation.
  4. src/scm/providers/cursor_origin/provider.py — Cursor Origin implementation.
  5. src/scm/test_fixtures.py — FakeProvider signature.
  6. bin/github-client and bin/gitlab-client — CLI usage docstring, argparse definition, and the call site that invokes the provider. No test enforces this, so it fails silently and is easy to miss — do not skip it.
  7. Tests under tests/unit/provider/test_github.py, tests/unit/provider/test_gitlab.py and tests/unit/provider/test_cursor_origin.py covering each branch of the new parameter.

Run uv run pytest tests/, uv run ruff check src tests, and uv run mypy src before committing.

Linting and formatting

Linting and formatting are enforced with prek (a drop-in pre-commit runner) via .pre-commit-config.yaml. Running uv sync installs prek, and direnv/.envrc installs the git pre-commit hook automatically. Run the hooks manually with uv run prek run --all-files. CI runs the same hooks on every pull request and pushes any autofixes back to the branch.