mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-06 08:26:41 -04:00
45ffe5aa6a
## Summary - Enforce **Conventional Commits** on PR titles (PRs are squash-merged, so the PR title becomes the final commit message). - Add a local `make lint-pr-title` target so contributors can validate titles before pushing. ## Why We squash-merge PRs, which means the final repository history is largely shaped by **PR titles**. Enforcing a consistent Conventional Commits format makes: - **Release notes & changelogs easier to generate** (types like `feat` / `fix` can be grouped automatically). - **History easier to scan** (uniform structure, optional scopes, explicit breaking changes via `!`). - **Automation more reliable** (future tooling can infer category and scope from the title). ## PR title format ```text type(scope)!: subject type: one of build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test scope: optional (e.g. web, api, actions, repo, …) !: optional, indicates a breaking change subject: short, imperative, no trailing period ``` ## Examples ```text feat(web): add dark mode toggle fix(api): avoid panic when repo is missing chore(ci): lint PR titles with commitlint refactor(templates): reduce duplication in repo list rendering feat!: remove legacy OAuth endpoint ``` ## Local testing ```text make deps-frontend make lint-pr-title PR_TITLE="feat(web): add dark mode toggle" ``` --------- Signed-off-by: Nicolas <bircni@icloud.com> Co-authored-by: nb <nb@users.noreply.local> Co-authored-by: GPT-5.2 <gpt-5.2@openai.com>
1.3 KiB
1.3 KiB
- Use
make helpto find available development targets - Run
make fmtto format.gofiles, and runmake lint-goto lint them - Run
make lint-jsto lint.tsfiles - Run
make tidyafter anygo.modchanges - Run single go tests with
go test -tags 'sqlite sqlite_unlock_notify' -run '^TestName$' ./modulepath/ - Run single js test files with
pnpm exec vitest <path-filter> - Run single playwright e2e test files with
GITEA_TEST_E2E_FLAGS='<filepath>' make test-e2e - Add the current year into the copyright header of new
.gofiles - Ensure no trailing whitespace in edited files
- Use Conventional Commits format for commit messages and PR titles (e.g.
type(scope): subject) - Never force-push, amend, or squash unless asked. Use new commits and normal push for pull request updates
- Preserve existing code comments, do not remove or rewrite comments that are still relevant
- In TypeScript, use
!(non-null assertion) instead of?./??when a value is known to always exist - For CSS layout, prefer
flex-*helpers over per-childtw-ml-*/tw-mr-*margins; fall back totw-*utilities when specificity requires!important - Include authorship attribution in issue and pull request comments
- Add
Co-Authored-Bylines to all commits, indicating name and model used