SHA256
Release notes come from the Gitea release page. tea's CHANGELOG.md and the changelog generator config (.changelog.yml) won't be maintained for gt, so both are removed together with the AGENTS.md rule about CHANGELOG.md. Reviewed-on: https://gitea.com/gitea/cli/pulls/24
2.6 KiB
2.6 KiB
- Never assume, verify before claiming
- Development targets are in the
Makefile; readCONTRIBUTING.mdfor the command style and package structure - PR descriptions: minimal, only what and why, no task or file listings. Aim for less than 1000 characters
- Reference issues and PRs by full URL, not by number
- Use Conventional Commits for commit messages and PR titles (
build,chore,ci,docs,enhance,feat,fix,perf,refactor,revert,style,test), withenhancefor user-facing enhancements. PRs are squash-merged with the PR title as the commit subject - Add an
Assisted-by: AGENT_NAME:MODEL_VERSIONtrailer to commit messages, neverCo-Authored-By. Only the human author adds the DCOSigned-off-by - Attribute agent authorship on one trailing line in issue and PR comments, never as a PR description section
- Never rewrite git history unless asked, update PRs with new commits and normal push
- Comments: write almost none, short and preferably same-line, explaining why for a future reader. Never narrate code, the change or the prompt. Preserve existing ones that still apply
- Add the current year to copyright headers of new
.gofiles - All Gitea API access goes through
internal/servicesongitea.dev/sdk;internal/appnever calls the API. Raw requests are only for SDK gaps, inraw.go, marked// TODO(sdk): <missing piece> - Return usage errors as
clierr.Wrap(clierr.Usage, …)before any request, worded like "X requires Y" or "X cannot be combined with Y";TestUsageErrorsPrecedeRequestschecks this - Keep help text, examples and
JSON FIELDSin sync with behavior. JSON goes to stdout, diagnostics and prompts to stderr; text from the server reaches a terminal only throughterminal.SafeWriter - In Go, prefer to use modern language features wherever possible
- Run
make fmtafter.goedits,make tidyaftergo.modedits, and check withmake vetandmake lint - Fix the cause rather than disabling a linter or weakening a test. Where unavoidable, use the narrowest scope with a trailing comment giving the reason
- Run single tests with
go test -run '^TestName$' ./internal/app/. Tests that run Git callgittest.Isolate(t)so the user's Git config does not leak in make integration-testruns theTestGitea*tests against a disposable Gitea 28 instance (seeCONTRIBUTING.md); never point them at a production instance- Every bug fix comes with a regression test that fails without it. Write the fewest, fastest tests covering the behavior, extending an existing one where possible, with
httptestservers for API behavior