From a5f6d06d220ee56290610055bd93879f2c995a28 Mon Sep 17 00:00:00 2001 From: sentomk Date: Wed, 29 Apr 2026 22:27:02 +0800 Subject: [PATCH] chore: add pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 18 +++++++++++++++ CONTRIBUTING.md | 39 ++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..2e441325 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ +## Summary + + +## Changes + + +## Tests + + +## Risk + + +## Checklist + +- [ ] Tests added or updated when behavior changed +- [ ] Documentation updated when public API or behavior changed +- [ ] Commit messages follow `CONTRIBUTING.md` +- [ ] PR targets `main` and passes required CI diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4da2c4e1..897123b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,14 +11,43 @@ See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for details. ## Before Submitting Changes -### 1. Discuss First +### 1. Branch and Pull Request Workflow + +The `main` branch is protected and should remain releasable. + +- Do not push directly to `main` +- Create focused branches for changes: + - `feat/` for new features + - `fix/` for bug fixes + - `docs/` for documentation + - `test/` for test-only changes + - `chore/` for maintenance +- Open a pull request into `main` +- Keep each pull request focused on one goal +- Ensure required CI passes before merging + +For concurrent local work, prefer `git worktree` over repeatedly stashing and +switching branches: + +```bash +git worktree add ../patternia-feat-example -b feat/example +git worktree add ../patternia-fix-example -b fix/example +git worktree list +git worktree remove ../patternia-feat-example +``` + +Pull request titles should follow the same style as commit subjects, such as +`feat(pattern): add case-insensitive string matching` or +`fix(eval): correct match_result type inference`. + +### 2. Discuss First For non-trivial changes (new features, API changes, or behavior modifications), please open an **Issue** or **Discussion** before submitting a pull request. This helps ensure alignment with the project’s design goals. -### 2. Code Style and Design Principles +### 3. Code Style and Design Principles Patternia is a design-focused C++ library. Please ensure that contributions adhere to the following principles: @@ -27,7 +56,7 @@ Patternia is a design-focused C++ library. Please ensure that contributions adhe - **Zero-overhead abstractions** - Maintain consistency with existing DSL and API design -### 3. Tests Required +### 4. Tests Required All logic changes must be accompanied by appropriate tests. @@ -35,13 +64,13 @@ All logic changes must be accompanied by appropriate tests. - Update existing tests when modifying behavior - Ensure all tests pass before submitting -### 4. Comment Style +### 5. Comment Style Follow the **[Google C++ Style Guide – Comment Style](https://google.github.io/styleguide/cppguide.html#Comment_Style)** for documentation comments. -### 5. Commit Style +### 6. Commit Style Use clear, conventional commit messages with a structured body.