From 0a7d031660c9e04191b6c3df64114cbf52095db5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 13:55:53 +0000 Subject: [PATCH 1/2] Initial plan From 3b19d7b36f2c907655070d242eaeeff8f0408022 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 14:07:38 +0000 Subject: [PATCH 2/2] docs: add linters package spec and cli dependency entry Agent-Logs-Url: https://github.com/github/gh-aw/sessions/1bc10ab1-e737-4782-84bb-9de8f503da17 Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --- pkg/cli/README.md | 1 + pkg/linters/README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 pkg/linters/README.md diff --git a/pkg/cli/README.md b/pkg/cli/README.md index b19c5e865e8..28a4f7b7019 100644 --- a/pkg/cli/README.md +++ b/pkg/cli/README.md @@ -467,6 +467,7 @@ err := cli.RunHealth(cli.HealthConfig{ - `github.com/github/gh-aw/pkg/timeutil` — human-readable duration formatting - `github.com/github/gh-aw/pkg/tty` — terminal detection - `github.com/github/gh-aw/pkg/types` — shared MCP server configuration types +- `github.com/github/gh-aw/pkg/typeutil` — type conversion helpers for dynamic frontmatter values - `github.com/github/gh-aw/pkg/fileutil` — file system helpers - `github.com/github/gh-aw/pkg/gitutil` — Git and GitHub CLI helpers - `github.com/github/gh-aw/pkg/repoutil` — repository name parsing and normalization diff --git a/pkg/linters/README.md b/pkg/linters/README.md new file mode 100644 index 00000000000..b7bb932904d --- /dev/null +++ b/pkg/linters/README.md @@ -0,0 +1,42 @@ +# linters Package + +The `linters` package namespace contains custom static analysis linters used by `gh-aw` quality checks. + +## Overview + +This package currently provides one custom Go analyzer in the `largefunc` subpackage: + +- `largefunc` — reports function bodies that exceed a configurable line-count threshold. + +## Public API + +### Subpackages + +| Subpackage | Description | +|------------|-------------| +| `largefunc` | Custom `go/analysis` analyzer that flags large functions with actionable diagnostics | + +## Usage Examples + +```go +import "github.com/github/gh-aw/pkg/linters/largefunc" + +// Use with multichecker, singlechecker, or custom go/analysis driver. +_ = largefunc.Analyzer +``` + +## Dependencies + +**External**: +- `golang.org/x/tools/go/analysis` — analyzer framework +- `golang.org/x/tools/go/analysis/passes/inspect` — AST inspection support +- `golang.org/x/tools/go/ast/inspector` — efficient AST traversal + +## Design Notes + +- The package is intentionally organized as a namespace (`pkg/linters/*`) so individual analyzers remain isolated and independently testable. +- `largefunc` exposes a `-max-lines` analyzer flag and defaults to `60` lines (`DefaultMaxLines`). + +--- + +*This specification is automatically maintained by the [spec-extractor](../../.github/workflows/spec-extractor.md) workflow.*