From 6efa5743d2d9c6f91393ba518794a14db3a5b484 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Nov 2026 00:55:24 +0000 Subject: [PATCH 1/2] Initial plan From 7548c51b351db444e7e7691c550a30e7bf4f78bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Nov 2026 01:10:11 +0000 Subject: [PATCH 2/2] Add lint JSON shorthand and document logs flags Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --- docs/src/content/docs/setup/cli.md | 8 ++++---- pkg/cli/lint_command.go | 2 +- pkg/cli/lint_command_test.go | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/src/content/docs/setup/cli.md b/docs/src/content/docs/setup/cli.md index 5e492b82ff3..227445a52ca 100644 --- a/docs/src/content/docs/setup/cli.md +++ b/docs/src/content/docs/setup/cli.md @@ -523,11 +523,11 @@ gh aw lint --rules secret-leak --json # Emit structured diagnostic gh aw lint --rules secret-leak --debug --json # Include incomplete-analysis warnings ``` -**Options:** `--dir/-d`, `--shellcheck`, `--pyflakes`, `--rules`, `--list-rules`, `--json`, `--debug`, `--javascript-module`, `--javascript-mode`, `--javascript-root`, `--javascript-runtime-path` +**Options:** `--dir/-d`, `--shellcheck`, `--pyflakes`, `--rules`, `--list-rules`, `--json/-j`, `--debug`, `--javascript-module`, `--javascript-mode`, `--javascript-root`, `--javascript-runtime-path` By default, shellcheck and pyflakes integrations are disabled to reduce noise for generated `run:` scripts. Built-in actionlint ignore patterns cover gh-aw-specific extensions such as `job.workflow_*` context properties and the `copilot-requests` permission scope. -`--rules` accepts comma-separated rule IDs; `--rules=` selects all registered rules without actionlint. Unknown IDs fail explicitly. `--json` requires `--rules` and has no `-j` shorthand; `--shellcheck` and `--pyflakes` apply only to actionlint. In the default mode, both linters run even if one reports errors, and either linter's failure produces a nonzero exit status. +`--rules` accepts comma-separated rule IDs; `--rules=` selects all registered rules without actionlint. Unknown IDs fail explicitly. `--json` requires `--rules` and supports the `-j` shorthand; `--shellcheck` and `--pyflakes` apply only to actionlint. In the default mode, both linters run even if one reports errors, and either linter's failure produces a nonzero exit status. Secret-leak coverage warnings are hidden by default in text and JSON output, unless JavaScript analysis is explicitly enabled. Use `--debug` to include them otherwise. Error findings, analysis failures, and other linters' warnings remain visible. This is a presentation setting: the AST runner retains all coverage diagnostics, and an empty CLI result is not proof of complete analysis. @@ -751,7 +751,7 @@ cat run-ids.txt | gh aw logs --stdin --repo owner/repo # required for bare num gh aw logs --runtime cloud-hypervisor # Filter to runs using a specific sandbox agent runtime ``` -**Options:** `--additional-grader`, `--after-run-id`, `--artifacts`, `--audit`, `--before-run-id`, `--cache-before`, `--cached-jsonl`, `--count/-c`, `--drain3-weights`, `--dry-run`, `--end-date`, `--engine/-e`, `--evals`, `--exclude-staged`, `--filtered-integrity`, `--firewall`, `--format`, `--graders`, `--harbor`, `--ignore-workflow-runs`, `--json/-j`, `--last`, `--max-github-api-rate-limit`, `--max-storage`, `--no-dry-run`, `--no-firewall`, `--output/-o`, `--parse`, `--prune-older-runs`, `--ref`, `--report-file`, `--repo/-r`, `--runtime`, `--safe-output`, `--start-date`, `--stdin`, `--summary-file`, `--timeout`, `--tool-graph`, `--train` +**Options:** `--additional-grader`, `--after-run-id`, `--artifacts`, `--audit`, `--before-run-id`, `--cache-before`, `--cached-jsonl`, `--count/-c`, `--drain3-weights`, `--dry-run`, `--end-date`, `--engine/-e`, `--episodes`, `--evals`, `--exclude-staged`, `--filtered-integrity`, `--firewall`, `--format`, `--graders`, `--harbor`, `--ignore-workflow-runs`, `--json/-j`, `--last`, `--max-github-api-rate-limit`, `--max-storage`, `--no-dry-run`, `--no-firewall`, `--outcomes`, `--outcomes-dir`, `--output/-o`, `--parse`, `--prune-older-runs`, `--ref`, `--report-file`, `--repo/-r`, `--runtime`, `--safe-output`, `--start-date`, `--stdin`, `--summary-file`, `--timeout`, `--tool-graph`, `--train` `logs` defaults `--artifacts` to `usage` for faster, compact downloads. When usage lacks `aw_info.json`, metadata is fetched from the compact `info` artifact before falling back to legacy activation artifacts. The `--last` flag is an alias for `--count/-c`. `--dry-run` selects only dry-run runs; `--no-dry-run` excludes them. These flags are mutually exclusive and work with workflow targets or `--stdin`. Older valid metadata without `dry_run` counts as a normal run; missing or malformed `aw_info.json` is excluded when either filter is active. Unified sessions preserve the flag as `workflow.info.data.dryRun`, and audit engine configuration exposes `dry_run`. @@ -1044,7 +1044,7 @@ gh aw logs episode 1234567890 --repo owner/repo --outcomes gh aw logs --outcomes --outcomes-dir ./otlp ``` -**Options:** `--json/-j`, `--repo/-r`, `--output/-o`, `--episodes`, `--outcomes-dir` +**Options:** `--json/-j`, `--repo/-r`, `--output/-o`, `--episodes`, `--outcomes`, `--outcomes-dir` The flag applies to selected runs in discovery, multi-workflow, stdin, and episode collection. JSON includes `.outcomes[]` with per-run observations and diff --git a/pkg/cli/lint_command.go b/pkg/cli/lint_command.go index d17ffd13ee5..fabe617fdf6 100644 --- a/pkg/cli/lint_command.go +++ b/pkg/cli/lint_command.go @@ -67,7 +67,7 @@ All registered AST rules run by default. Use --rules to select AST rules and ski cmd.Flags().Bool("pyflakes", false, "Enable pyflakes integration in actionlint") cmd.Flags().StringSlice("rules", nil, "Select built-in AST rules and skip actionlint (default: all AST rules plus actionlint; empty selects all)") cmd.Flags().Bool("list-rules", false, "List available built-in AST lint rules") - cmd.Flags().Bool("json", false, "Emit structured diagnostics (requires --rules)") + cmd.Flags().BoolP("json", "j", false, "Emit structured diagnostics (requires --rules)") cmd.Flags().Bool("debug", false, "Include secret-leak analysis coverage warnings for investigation") registerJavaScriptLintFlags(cmd) // The root routes help to stderr. Structured lint reports belong on stdout. diff --git a/pkg/cli/lint_command_test.go b/pkg/cli/lint_command_test.go index 87bc2ddd0f6..f24e763ec96 100644 --- a/pkg/cli/lint_command_test.go +++ b/pkg/cli/lint_command_test.go @@ -20,6 +20,7 @@ func TestNewLintCommand(t *testing.T) { assert.Equal(t, "lint", cmd.Name(), "Command name should be 'lint'") require.NotNil(t, cmd.Flags().Lookup("dir"), "lint command should have a --dir flag") assert.Equal(t, "d", cmd.Flags().Lookup("dir").Shorthand, "--dir should have -d shorthand") + assert.Equal(t, "j", cmd.Flags().Lookup("json").Shorthand, "--json should have -j shorthand") assert.Equal(t, "Workflow directory (default: $GH_AW_WORKFLOWS_DIR or .github/workflows)", cmd.Flags().Lookup("dir").Usage,