You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
This PR improves the developer experience by adding clear linting
documentation and optional pre-commit hooks to catch issues before CI.
Helpful to avoid fighting Claude Code / Copilot on "please make sure
linting passes CI".
## Changes
- Updated `README.md` with:
- Go 1.23.x requirement (was "1.18 or later")
- golangci-lint v1.61.0 in prerequisites
- New Development section with linting instructions
- Updated `CLAUDE.md` with:
- Development Setup section
- Added `.githooks/pre-commit`:
- Runs golangci-lint and gofmt checks
- References README for installation instructions
- Can be bypassed with `--no-verify` when needed
## Test Plan
- [x] Verified pre-commit hook blocks commits when golangci-lint is
missing
- [x] Confirmed hook shows clear error message pointing to README
- [x] Tested that linting passes with Go 1.23.0 and golangci-lint
v1.61.0
- [x] Verified gofmt correctly identifies formatting issues
Co-authored w/ Claude Code
---------
Co-authored-by: Charles Lowell <[email protected]>
Copy file name to clipboardExpand all lines: CLAUDE.md
+22-4Lines changed: 22 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,22 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
5
5
## Overview
6
6
MCP Registry is a community-driven registry service for Model Context Protocol (MCP) servers. It provides a centralized repository for discovering and managing MCP implementations.
7
7
8
+
## Development Setup
9
+
10
+
### Prerequisites
11
+
-**Go 1.23.x** - The project requires this specific version (check with `go version`)
12
+
- Consider using a Go version manager like `g` or `gvm` if you work on multiple projects
The easiest way to get the registry running is to use `docker compose`. This will setup the MCP Registry service, import the seed data and run MongoDB in a local Docker environment.
@@ -54,6 +60,33 @@ This will create the `registry` binary in the current directory. You'll need to
54
60
55
61
By default, the service will run on `http://localhost:8080`.
56
62
63
+
## Development
64
+
65
+
### Linting
66
+
67
+
The project uses golangci-lint with extensive checks. Always run linting before pushing:
68
+
69
+
```bash
70
+
# Run all linters (same as CI)
71
+
golangci-lint run --timeout=5m
72
+
73
+
# Check formatting
74
+
gofmt -s -l .
75
+
76
+
# Fix formatting
77
+
gofmt -s -w .
78
+
```
79
+
80
+
### Git Hooks (Optional)
81
+
82
+
To automatically run linting before commits:
83
+
84
+
```bash
85
+
git config core.hooksPath .githooks
86
+
```
87
+
88
+
This will prevent commits that fail linting or have formatting issues.
0 commit comments