Skip to content

Commit 46c8806

Browse files
committed
chore: add pre-commit hooks for lint and update readme
1 parent c751e16 commit 46c8806

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

.githooks/pre-commit

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Running vet..."
5+
go vet ./...
6+
7+
echo "Running format check..."
8+
UNFORMATTED=$(gofumpt -l . 2>/dev/null || gofmt -l .)
9+
if [ -n "$UNFORMATTED" ]; then
10+
echo "Files need formatting:"
11+
echo "$UNFORMATTED"
12+
exit 1
13+
fi
14+
15+
echo "Running tests..."
16+
go test -race ./...
17+
18+
echo "Running build..."
19+
go build ./...
20+
21+
echo "All checks passed."

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ if err != nil {
144144
| `NotFoundError` | 404 | No RDAP data found |
145145
| `RateLimitError` | 429 | Rate limit or quota exceeded |
146146
| `UpstreamError` | 502 | Upstream RDAP server failure |
147+
| `TemporarilyUnavailableError` | 503 | Domain data temporarily unavailable |
147148

148149
All typed errors embed `*APIError` which provides `StatusCode`, `Code`, `Message`, and `RetryAfter` fields.
149150

@@ -157,6 +158,14 @@ if domain.Dates.Expires != nil {
157158
}
158159
```
159160

161+
## Development
162+
163+
Set up pre-commit hooks (runs lint + tests before each commit):
164+
165+
```bash
166+
git config core.hooksPath .githooks
167+
```
168+
160169
## License
161170

162171
MIT — see [LICENSE](LICENSE).

0 commit comments

Comments
 (0)