Skip to content

Commit 3e9dbaf

Browse files
committed
docs: add CONTRIBUTING.md, issue templates, and PR template
1 parent 574f5ad commit 3e9dbaf

4 files changed

Lines changed: 136 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Report a bug in patchright-go
4+
labels: bug
5+
---
6+
7+
## Description
8+
9+
A clear description of the bug.
10+
11+
## Steps to reproduce
12+
13+
```go
14+
// Minimal code to reproduce the issue
15+
```
16+
17+
## Expected behavior
18+
19+
What you expected to happen.
20+
21+
## Actual behavior
22+
23+
What actually happened. Include error messages and stack traces.
24+
25+
## Environment
26+
27+
- OS: [e.g. Windows 11, Ubuntu 24.04]
28+
- Go version: [e.g. 1.23]
29+
- patchright-go version: [e.g. v0.0.1]
30+
- Headless or headful:
31+
- Browser channel: [e.g. chromium, chrome]
32+
33+
## Additional context
34+
35+
- Are you using `NewStealthPage` or `NewPage`?
36+
- Does the issue happen with standard playwright-go?
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest a feature or improvement
4+
labels: enhancement
5+
---
6+
7+
## Description
8+
9+
What you'd like to see added or changed.
10+
11+
## Use case
12+
13+
Why this would be useful. What problem does it solve?
14+
15+
## Proposed solution
16+
17+
How you think it could work (optional).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Summary
2+
3+
What this PR does and why.
4+
5+
## Changes
6+
7+
-
8+
9+
## Testing
10+
11+
- [ ] `go build ./...` passes
12+
- [ ] `go vet ./...` passes
13+
- [ ] All existing tests pass
14+
- [ ] New tests added for new functionality
15+
- [ ] Tested with `NewStealthPage` against a protected site (if anti-detection related)
16+
17+
## Notes
18+
19+
Anything reviewers should know.

CONTRIBUTING.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Contributing to patchright-go
2+
3+
## Development workflow
4+
5+
1. **Plan** — open an issue or discuss the change before writing code
6+
2. **Code** — implement on a feature branch
7+
3. **Test** — all existing tests must pass, add tests for new functionality
8+
4. **Review** — check for bugs, concurrency issues, and memory efficiency
9+
5. **PR** — create a pull request against `main`
10+
11+
## Setup
12+
13+
```bash
14+
git clone https://github.com/status403com/patchright-go.git
15+
cd patchright-go
16+
go build ./...
17+
go run ./cmd/patchright install chromium
18+
```
19+
20+
## Running tests
21+
22+
```bash
23+
# Unit tests only
24+
go test -short ./...
25+
26+
# Full suite including integration tests (requires installed browser)
27+
go test ./... -timeout 120s
28+
29+
# With race detector
30+
go test -race ./...
31+
```
32+
33+
## Code style
34+
35+
- Follow standard Go conventions (`gofmt`, `go vet`)
36+
- Keep functions under 50 lines, files under 800 lines
37+
- Handle all errors explicitly
38+
- Use `sync.Once`, `atomic.Bool`, or mutexes for shared state — never bare bools
39+
- Prefer immutable patterns where possible
40+
41+
## What to contribute
42+
43+
- Bug fixes with test cases
44+
- Performance improvements (especially for high-throughput scenarios)
45+
- Anti-detection improvements
46+
- Documentation updates
47+
- New examples
48+
49+
## What not to change
50+
51+
- `generated-*.go` files are auto-generated from the Playwright protocol — modify the generator, not the output (except for Patchright-specific additions clearly marked with comments)
52+
- Don't add Firefox or WebKit support — Patchright is Chromium-only
53+
54+
## Updating to a new Patchright version
55+
56+
1. Update `patchrightCliVersion` in `run.go`
57+
2. Check if `nodeVersion` needs updating
58+
3. Run `scripts/generate-api.sh` if the protocol changed
59+
4. Run all tests
60+
5. Test `NewStealthPage` against a protected site
61+
62+
## License
63+
64+
By contributing, you agree that your contributions will be licensed under Apache-2.0.

0 commit comments

Comments
 (0)