Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
go-version-file: go.mod
cache: true

- name: Check for typos
uses: crate-ci/typos@631208b7aac2daa8b707f55e7331f9112b0e062d # v1.44.0
with:
config: .github/workflows/typos.toml

- name: Lint
run: make lint

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[default]
extend-ignore-re = ["(#|//)\\s*spellchecker:ignore-next-line\\n.*"]

[default.extend-words]
trialer = "trialer"

[files]
extend-exclude = [
"go.sum",
"go.mod",
# Fixtures contain truncated streaming chunks that look like typos
"fixtures/**",
# Test files contain hashes and redacted values that look like typos
"**/*_test.go",
]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

# Project specific
example/aibridge.db
build/

20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,32 @@ SHELL_SRC_FILES := $(shell find . -type f -name '*.sh' -not -path '*/.git/*')
GOLANGCI_LINT_VERSION ?= 1.64.8
PARALLELTESTCTX_VERSION ?= 0.0.1

lint: lint/shellcheck lint/go
lint: lint/shellcheck lint/go lint/typos
.PHONY: lint

lint/go:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v$(GOLANGCI_LINT_VERSION) run
go run github.com/coder/paralleltestctx/cmd/paralleltestctx@v$(PARALLELTESTCTX_VERSION) -custom-funcs="testutil.Context" ./...
.PHONY: lint/go

TYPOS_VERSION := $(shell grep -oP 'crate-ci/typos@\S+\s+\#\s+v\K[0-9.]+' .github/workflows/ci.yml)
TYPOS_ARCH := $(shell uname -m)
ifeq ($(shell uname -s),Darwin)
TYPOS_OS := apple-darwin
else
TYPOS_OS := unknown-linux-musl
endif

build/typos-$(TYPOS_VERSION):
mkdir -p build/
curl -sSfL "https://github.com/crate-ci/typos/releases/download/v$(TYPOS_VERSION)/typos-v$(TYPOS_VERSION)-$(TYPOS_ARCH)-$(TYPOS_OS).tar.gz" \
| tar -xzf - -C build/ ./typos
mv build/typos "$@"

lint/typos: build/typos-$(TYPOS_VERSION)
build/typos-$(TYPOS_VERSION) --config .github/workflows/typos.toml
.PHONY: lint/typos

lint/shellcheck:
if test -n "$(strip $(SHELL_SRC_FILES))"; then \
echo "--- shellcheck"; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ See [example/](example/) for a complete runnable example with SQLite persistence
5. **Test with Claude Code**:
Claude Code allows a base URL override via `ANTHROPIC_BASE_URL`.

![image with cloude code example](example/claude-code.png)
![image with claude code example](example/claude-code.png)

## Supported Routes

Expand Down
2 changes: 1 addition & 1 deletion intercept/apidump/apidump.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (d *dumper) dumpResponse(resp *http.Response) error {
// writeRedactedHeaders writes HTTP headers in wire format (Key: Value\r\n) to w,
// redacting sensitive values and applying any overrides. Headers are sorted by key
// for deterministic output.
// `sensitive` and `overrides` must both supply keys in canoncialized form.
// `sensitive` and `overrides` must both supply keys in canonicalized form.
// See [textproto.MIMEHeader].
func (*dumper) writeRedactedHeaders(w io.Writer, headers http.Header, sensitive map[string]struct{}, overrides map[string]string) error {
// Collect all header keys including overrides.
Expand Down
Loading