|
1 | 1 | # Contributing to HackBrowserData |
2 | 2 |
|
3 | | -We appreciate your interest in contributing to the HackBrowserData! This document provides some basic guidelines for contributors. |
| 3 | +We appreciate your interest in contributing to HackBrowserData! This document provides guidelines for contributors. |
4 | 4 |
|
5 | 5 | ## Getting Started |
6 | 6 |
|
7 | | -- Always base your work from the `dev` branch, which is the development branch with the latest code. |
| 7 | +- Always base your work from the `main` branch. |
8 | 8 | - Before creating a Pull Request (PR), make sure there is a corresponding issue for your contribution. If there isn't one already, please create one. |
9 | | -- Include the problem description in the issue. |
| 9 | + |
| 10 | +## Go Version Constraint |
| 11 | + |
| 12 | +This project **must build with Go 1.20** to maintain Windows 7 support. This is enforced by CI. |
| 13 | + |
| 14 | +- Do **not** use features from Go 1.21+ (e.g., `log/slog`, `slices`, `maps`, `cmp` packages) |
| 15 | +- Do **not** bump the `go` directive in `go.mod` beyond `go 1.20` |
| 16 | +- `modernc.org/sqlite` is pinned at v1.31.1 (v1.32+ requires Go 1.21) |
| 17 | + |
| 18 | +## Development Commands |
| 19 | + |
| 20 | +```bash |
| 21 | +# Build |
| 22 | +go build ./cmd/hack-browser-data/ |
| 23 | + |
| 24 | +# Test |
| 25 | +go test ./... |
| 26 | + |
| 27 | +# Lint (requires golangci-lint v2) |
| 28 | +golangci-lint run |
| 29 | + |
| 30 | +# Format |
| 31 | +gofumpt -l -w . |
| 32 | +goimports -w -local github.com/moond4rk/hackbrowserdata . |
| 33 | + |
| 34 | +# Spelling check |
| 35 | +typos |
| 36 | +``` |
10 | 37 |
|
11 | 38 | ## Pull Requests |
12 | 39 |
|
13 | 40 | When creating a PR, please follow these guidelines: |
14 | 41 |
|
15 | 42 | - Link your PR to the corresponding issue. |
16 | | -- Provide context in the PR description to help reviewers understand the changes. The more information you provide, the faster the review process will be. |
17 | | -- Include an example of running the tool with the changed code, if applicable. Provide 'before' and 'after' examples if possible. |
| 43 | +- Provide context in the PR description to help reviewers understand the changes. |
| 44 | +- Include 'before' and 'after' examples if applicable. |
18 | 45 | - Include steps for functional testing or replication. |
19 | 46 | - If you're adding a new feature, make sure to include unit tests. |
20 | 47 |
|
| 48 | +### Commit Message Convention |
| 49 | + |
| 50 | +Use [Conventional Commits](https://www.conventionalcommits.org/) format: |
| 51 | + |
| 52 | +``` |
| 53 | +feat: add support for new browser |
| 54 | +fix: resolve cookie decryption on Windows |
| 55 | +chore: update dependencies |
| 56 | +docs: improve RFC documentation |
| 57 | +refactor: simplify profile discovery logic |
| 58 | +test: add extraction tests for Firefox |
| 59 | +``` |
| 60 | + |
21 | 61 | ## Code Style |
22 | 62 |
|
23 | | -Please adhere to the existing coding style for consistency. |
| 63 | +- **Platform code**: use build tags (`_darwin.go`, `_windows.go`, `_linux.go`) |
| 64 | +- **Error handling**: use `fmt.Errorf("context: %w", err)` for wrapping; do not ignore errors unless it is deliberate best-effort cleanup (e.g. `Close`/`Remove`) |
| 65 | +- **Naming**: follow Go conventions |
| 66 | +- **Tests**: use `t.TempDir()` for filesystem tests |
| 67 | +- **Architecture**: see `rfcs/` for design documents |
24 | 68 |
|
25 | 69 | ## Questions |
26 | 70 |
|
27 | | -If you have any questions or need further guidance, please feel free to ask in the issue or PR, or [reach out to the maintainers](mailto:i@moond4rk.com). We will reply to you as soon as possible. |
| 71 | +If you have any questions or need further guidance, please feel free to ask in the issue or PR, or [reach out to the maintainers](mailto:me@moond4rk.com). We will reply to you as soon as possible. |
28 | 72 |
|
29 | 73 | Thank you for your contribution! |
30 | | - |
|
0 commit comments