From 2eec29c7c47bcc4ab8cf3211e98bed16e0839ffa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 02:36:17 +0000 Subject: [PATCH 1/2] Initial plan From 79546739a73196ebb55d5f88036cb45ee0ea1b13 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 02:44:16 +0000 Subject: [PATCH 2/2] docs: add test file linting requirements to AGENTS.md Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- AGENTS.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index ce8cf3edca..36a513bf7e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -73,6 +73,45 @@ make build # Rebuild gh-aw after modifying JSON schemas in pkg/parser/sche ``` Schema files are embedded in the binary using `//go:embed` directives, so changes require rebuilding the binary. +**ALWAYS RUN LINTERS AFTER ADDING TEST FILES:** + +When adding new test files (`*_test.go`), the **unused** linter may catch helper functions that are defined but never called. Always run linters after creating test files to catch these issues early. + +```bash +make lint # Catches unused, testifylint, misspell, unconvert issues +``` + +**Common linting issues in test files:** + +1. **unused**: Helper functions defined but never called + - ❌ BAD: Defining `func hasInternalPrefix(key string) bool { ... }` but never using it + - ✅ GOOD: Either use the function in tests or remove it + +2. **testifylint**: Assertion best practices + - Always provide descriptive assertion messages + - Use `require.*` for setup assertions that must pass + - Use `assert.*` for test validations + - Use `assert.Error(t, err, "msg")` not `assert.NotNil(t, err)` + - Use `assert.NoError(t, err, "msg")` not `assert.Nil(t, err)` + +**Before committing test files:** +```bash +make agent-finish # REQUIRED - Full validation including lint +``` + +**Example of correct test code:** +```go +// ✅ CORRECT - Using helper functions +func TestCompile(t *testing.T) { + compiler := NewCompiler() + require.NotNil(t, compiler, "Compiler should be created") + + // Use helper function if defined + err := compiler.Compile("test.md") + assert.NoError(t, err, "Should compile valid workflow") +} +``` + **ALWAYS USE GITHUB MCP FOR GITHUB API ACCESS WITH COPILOT ENGINE:** The Copilot agent **cannot directly access api.github.com**. When using the `copilot` engine, you **must** configure the GitHub MCP server to access GitHub information (repositories, issues, pull requests, etc.).