From 2bb0ab032bb627b25d340b156c8d63ec0bdf708b Mon Sep 17 00:00:00 2001 From: Patel230 Date: Tue, 9 Jun 2026 01:14:04 +0530 Subject: [PATCH] chore: sync lint config and docs --- .gitignore | 1 + .golangci.yml | 32 +++++++++++++++++--------------- CHANGELOG.md | 2 -- SECURITY.md | 4 ++-- docs/architecture.md | 2 +- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 05f1a4e..084f305 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ bin/ dist/ # Stray example binaries (e.g. `go build` run inside examples/* leaving the binary at repo root) /basic +/examples/basic/basic /examples/*/main examples/**/*.bin diff --git a/.golangci.yml b/.golangci.yml index bcadfff..ddd154c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,6 +14,23 @@ linters: - whitespace - bodyclose - noctx + settings: + errcheck: + check-type-assertions: true + check-blank: false + gocritic: + enabled-tags: + - diagnostic + - performance + disabled-checks: + - hugeParam + - rangeValCopy + - appendAssign + # appendCombine hurts readability when each appended item is a + # documented struct literal. + - appendCombine + staticcheck: + checks: ["all", "-SA1019"] exclusions: presets: - comments @@ -26,21 +43,6 @@ linters: - noctx - bodyclose -linters-settings: - errcheck: - check-type-assertions: true - check-blank: false - gocritic: - enabled-tags: - - diagnostic - - performance - disabled-checks: - - hugeParam - - rangeValCopy - - appendAssign - staticcheck: - checks: ["all", "-SA1019"] - issues: max-issues-per-linter: 0 max-same-issues: 0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 600a056..bd83967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,8 +30,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `.github/workflows/ci.yml` — race tests + coverage upload + lint (golangci-lint v2) + multi-platform build matrix (linux/darwin/windows × amd64/arm64) + govulncheck. - - `.github/dependabot.yml` — weekly `gomod` + `github-actions` - updates. - `.github/PULL_REQUEST_TEMPLATE.md` — Summary / Changes / API impact / Daemon compatibility / Testing / Checklist. - `.github/ISSUE_TEMPLATE/bug_report.yml` — structured bug report. diff --git a/SECURITY.md b/SECURITY.md index ebe7032..c65831c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -44,8 +44,8 @@ We follow [coordinated vulnerability disclosure](https://en.wikipedia.org/wiki/C ## Security practices in this repo -- **Dependency monitoring:** automated via Dependabot (see - `.github/dependabot.yml`). +- **Dependency monitoring:** vulnerable dependencies are detected by + `govulncheck`, which runs on every CI build (see "Vulnerability scanning"). - **Static analysis:** `golangci-lint` / `ruff` / `mypy` enforced in CI. - **Vulnerability scanning:** `govulncheck` (Go) / `pip-audit` (Python) run on every CI build. diff --git a/docs/architecture.md b/docs/architecture.md index 01f4baf..e96458e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -57,7 +57,7 @@ resp, err := c.Chat(ctx, hawksdk.ChatRequest{Message: "list files"}) // 📡 Streaming chat stream, err := c.ChatStream(ctx, hawksdk.ChatRequest{Message: "explain this code"}) defer stream.Close() -for stream.Next() { fmt.Print(stream.Event().Data) } +for { ev, err := stream.Next(); if err != nil { break }; fmt.Print(ev.Data) } // 📋 Sessions sessions, _ := c.Sessions(ctx, hawksdk.ListOptions{Limit: 10})