Skip to content

Commit f6037c0

Browse files
authored
docs(contributing): add CONTRIBUTING.md (#34)
Codifies the PR workflow, coding standards, and gates (make lint, make test-coverage at 100%, conventional commits and branch prefixes, CODEOWNER review). Unblocks the OpenSSF Best Practices contribution_requirements question and is a silver-tier requirement.
1 parent 29223e0 commit f6037c0

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Contributing
2+
3+
Thanks for your interest in improving `queue`. This document is the contract for contributions.
4+
5+
## Getting started
6+
7+
```bash
8+
git clone https://github.com/adrianbrad/queue.git
9+
cd queue
10+
go test ./...
11+
```
12+
13+
Go 1.20+ is required.
14+
15+
## Reporting bugs and proposing features
16+
17+
- Bugs: <https://github.com/adrianbrad/queue/issues>
18+
- Security issues: see [SECURITY.md](SECURITY.md) — do **not** file public issues for security problems.
19+
- Feature ideas: open an issue first to discuss scope before opening a PR.
20+
21+
## Pull request workflow
22+
23+
1. Fork, then branch from `main`. Use [conventional-branch](https://conventional-branch.github.io/) prefixes: `feature/`, `bugfix/`, `chore/`, `hotfix/`.
24+
2. Make changes on the branch. Keep PRs focused — one logical change per PR.
25+
3. Ensure every local gate passes before pushing:
26+
```bash
27+
make lint # golangci-lint --fix; must be clean
28+
make test-coverage # unit + race tests; fails if coverage != 100%
29+
```
30+
4. Open a PR against `main`.
31+
5. CI must be green: `Lint`, `Test`, `Analyze` (CodeQL), `gitleaks`, `grype`.
32+
33+
## Coding standards
34+
35+
- Style: `gofumpt` + `goimports` (applied by `make lint --fix`).
36+
- Lint config: [`.golangci.yml`](.golangci.yml). New code must satisfy every enabled linter.
37+
- Tests: every exported behavior must be covered. Coverage gate is **100%** of statements; PRs that drop coverage will fail CI.
38+
- Concurrency: queue implementations must remain safe under `-race`. Add a regression test when touching locking.
39+
40+
## Commit messages
41+
42+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
43+
44+
```
45+
<type>(<scope>): <summary>
46+
47+
<optional body explaining the *why*>
48+
```
49+
50+
Types used here: `feat`, `fix`, `perf`, `refactor`, `test`, `docs`, `style`, `build`, `chore`.
51+
52+
## Review
53+
54+
- A CODEOWNER approval is required (see [`.github/CODEOWNERS`](.github/CODEOWNERS)).
55+
- Status checks must pass; the branch must be up to date with `main`.
56+
- Discussions are resolved before merge; commits are squash-merged.
57+
58+
## Release process
59+
60+
Tagged releases follow [SemVer](https://semver.org/). Maintainers bump the version by tagging `vX.Y.Z` on `main`; `CHANGELOG.md` is updated in the same commit.

0 commit comments

Comments
 (0)