Skip to content

Enable 16 additional Go linters and fix all reported issues - #17714

Merged
pelikhan merged 4 commits into
mainfrom
copilot/enable-more-go-linters
Feb 22, 2026
Merged

Enable 16 additional Go linters and fix all reported issues#17714
pelikhan merged 4 commits into
mainfrom
copilot/enable-more-go-linters

Conversation

CopilotAI commented Feb 22, 2026

Copy link
Copy Markdown
Contributor
  • Enable linters that produce zero issues (bodyclose, gocheckcompilerdirectives, recvcheck, copyloopvar, exptostd, durationcheck, fatcontext, nosprintfhostport, reassign)
  • Fix modernize issue (1 existing issue in known_needs_expressions.go)
  • Fix errorlint issues (type assertions → errors.As, error comparisons → errors.Is, %v → %w) and enable the linter
  • Fix usestdlibvars issues (http.MethodGet, http.StatusOK) and enable the linter
  • Fix mirror issues (WriteRune instead of WriteString(string(rune))) and enable the linter
  • Fix nolintlint issues (remove leading space from //nolint directives) and enable the linter
  • Fix wastedassign issues and enable the linter
  • Fix makezero issues (use append([]T(nil), src...) idiom) and enable the linter
  • Fix perfsprint issues (fmt.Sprintf → strconv, string concat loops → Builder) and enable the linter
  • Fix CI failure: revert intentional %v→%w change in compiler_orchestrator_frontmatter.go (was exposing os.PathError in error chain, breaking TestStandardLibraryErrorsNotExposed); add nolint comment
  • Fix preconditions.go: replace empty errors.New("") with descriptive error messages; restore missing case "selected": label
  • Fix expression_parser.go: use WriteByte instead of WriteString(string(byte)) to avoid per-iteration allocations
  • Run make golint - all 0 issues confirmed
  • All affected tests pass
Original prompt

Review enabled go linters and enable more


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.



✨ PR Review Safe Output Test - Run 22279080836

💥 [THE END] — Illustrated by Smoke Claude

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Review and enable additional Go lintersEnable 16 additional Go linters and fix all reported issuesFeb 22, 2026
@pelikhan
pelikhan marked this pull request as ready for review February 22, 2026 14:14
CopilotAI review requested due to automatic review settings February 22, 2026 14:14

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the repo’s Go static analysis coverage by enabling 16 additional golangci-lint linters and applies broad, mechanical fixes across the codebase so the newly enabled linters pass.

Changes:

  • Enabled additional golangci-lint linters (error handling correctness, perf, stdlib vars, nolint hygiene).
  • Updated error handling patterns (errors.Is/errors.As, %w wrapping) and replaced simple fmt.Errorf/fmt.Sprintf usage where faster/std alternatives apply.
  • Reduced allocation hotspots in string building (e.g., strings.Builder, WriteRune, strconv formatting).

Reviewed changes

Copilot reviewed 246 out of 247 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
.golangci.ymlEnables additional linters that motivated the codebase-wide mechanical changes.
cmd/gh-aw/main.goReplaces simple formatted errors/strings with errors.New/concatenation where appropriate.
pkg/cli/access_log.goReplaces fmt.Sprintf for simple concatenation in verbose output.
pkg/cli/actionlint.goAvoids fmt.Sprintf in constant URL and improves error typing for *exec.ExitError via errors.As.
pkg/cli/add_interactive_auth.goUses errors.New and string concatenation for simple messages.
pkg/cli/add_interactive_engine.goAvoids fmt.Sprintf for simple informational output.
pkg/cli/add_interactive_git.goUses errors.As for exit errors; replaces numeric formatting with strconv.
pkg/cli/add_interactive_orchestrator.goUses errors.New for simple error returns.
pkg/cli/add_workflow_pr.goUses concatenation for commit/PR messages and success output.
pkg/cli/add_workflow_resolution.goUses errors.New for simple validation failures and output concatenation.
pkg/cli/audit.goUses concatenation/strconv for simple formatting and CLI arg construction.
pkg/cli/audit_report_analysis.goAvoids fmt.Sprintf in simple string building for report text.
pkg/cli/audit_report_render.goUses strconv for numeric formatting in tables.
pkg/cli/audit_test.goSwitches to errors.New in tests for non-wrapping errors.
pkg/cli/codemod_bots.goAvoids fmt.Sprintf when no formatting is needed.
pkg/cli/codemod_mcp_network.goAvoids fmt.Sprintf when no formatting is needed for YAML line construction.
pkg/cli/codemod_roles.goAvoids fmt.Sprintf when no formatting is needed.
pkg/cli/commands.goAvoids fmt.Sprintf in verbose logging and GitHub API path construction.
pkg/cli/compile_batch_operations.goUses concatenation for simple status output.
pkg/cli/compile_helpers.goUses concatenation for simple progress/status output.
pkg/cli/compile_orchestration.goUses errors.New for simple “compilation failed” sentinel errors and concatenation for status output.
pkg/cli/compile_post_processing.goUses concatenation for simple success output.
pkg/cli/compile_stats.goUses strconv for numeric formatting in stats tables.
pkg/cli/compile_validation.goUses errors.New for simple config validation failures.
pkg/cli/compile_watch.goUses errors.New for watcher channel closure errors.
pkg/cli/compile_workflow_processor.goUses errors.As for typed shared-workflow error detection.
pkg/cli/copilot_agent.goAvoids fmt.Sprintf for simple informational output.
pkg/cli/copilot_agents.goAvoids fmt.Sprintf for simple informational/success output.
pkg/cli/copilot_setup.goUses errors.New for simple errors and avoids fmt.Sprintf for simple action refs/strings.
pkg/cli/deps_outdated.goUses errors.New for simple “not in module” errors and avoids fmt.Sprintf in verbose output.
pkg/cli/deps_security.goUses stdlib constant http.MethodGet and avoids fmt.Sprintf in verbose output.
pkg/cli/docker_images.goUses errors.New for simple “docker not available” error.
pkg/cli/download_workflow.goUses %w for both errors when returning combined API+git failures.
pkg/cli/enable.goUses errors.New for simple missing-gh error; improves error-with-suggestions formatting.
pkg/cli/error_formatting_test.goAvoids fmt.Sprintf for filepath concatenation; uses errors.New in wrapping tests.
pkg/cli/file_tracker.goAvoids fmt.Sprintf for simple verbose messages.
pkg/cli/firewall_log.goAvoids fmt.Sprintf for simple informational output.
pkg/cli/fix_command.goAvoids fmt.Sprintf for simple status markers.
pkg/cli/frontmatter_editor.goUses append([]T(nil), ...) to copy slices; uses errors.New for simple errors.
pkg/cli/gateway_logs.goUses errors.New for simple “gateway.jsonl not found” errors.
pkg/cli/generate_action_metadata_command.goUses errors.New for simple “no actions” error and avoids fmt.Sprintf for simple output text.
pkg/cli/hash_command.goAvoids fmt.Sprintf for simple error output.
pkg/cli/health_command.goUses strconv for integer formatting and avoids fmt.Sprintf for simple “$” prefix.
pkg/cli/health_metrics.goUses strconv for token formatting below 1000.
pkg/cli/imports.goAvoids fmt.Sprintf for simple warning output.
pkg/cli/init.goUses errors.New for simple precondition failures.
pkg/cli/interactive.goUses errors.New for non-interactive/CI guardrails and avoids fmt.Sprintf for simple labels.
pkg/cli/log_aggregation.goAvoids fmt.Sprintf for simple informational output.
pkg/cli/logs_cache.goAvoids fmt.Sprintf for simple “saved” output.
pkg/cli/logs_download.goUses errors.New for auth-required errors and avoids fmt.Sprintf for simple verbose/success messages.
pkg/cli/logs_github_api.goUses errors.As for exit error inspection; uses errors.New for auth-required error; avoids fmt.Sprintf in verbose “Executing” output.
pkg/cli/logs_parallel_test.goUses errors.Is for context cancellation assertion.
pkg/cli/logs_parsing_core.goAvoids fmt.Sprintf for simple verbose output.
pkg/cli/logs_parsing_firewall.goAvoids fmt.Sprintf for simple informational output.
pkg/cli/logs_parsing_javascript.goAvoids fmt.Sprintf for simple warning output.
pkg/cli/logs_report.goAvoids fmt.Sprintf for simple success output.
pkg/cli/logs_utils.goAvoids fmt.Sprintf for simple verbose output.
pkg/cli/mcp_config_file.goAvoids fmt.Sprintf for simple “Existing file detected” output.
pkg/cli/mcp_inspect.goUses errors.As for shared workflow errors and uses errors.New for flag validation.
pkg/cli/mcp_inspect_inspector.goAvoids fmt.Sprintf for simple “Starting server” output.
pkg/cli/mcp_inspect_list.goUses errors.New for missing workflows directory error.
pkg/cli/mcp_inspect_mcp.goAvoids fmt.Sprintf in connection strings and output headers; avoids fmt.Sprintf for simple verbose info.
pkg/cli/mcp_inspect_safe_inputs_files.goAvoids fmt.Sprintf for simple verbose output.
pkg/cli/mcp_inspect_safe_inputs_inspector.goUses errors.New for simple missing-config/port/timeouts and avoids fmt.Sprintf for simple output.
pkg/cli/mcp_inspect_safe_inputs_server.goUses errors.New for simple port/timeouts and avoids fmt.Sprintf for simple verbose output.
pkg/cli/mcp_list.goUses strconv for counts and avoids fmt.Sprintf in table titles.
pkg/cli/mcp_registry.goAvoids fmt.Sprintf for simple URL construction.
pkg/cli/mcp_registry_improvements_test.goUses http.StatusOK instead of literal 200.
pkg/cli/mcp_registry_list.goAvoids fmt.Sprintf for simple informational output and table title.
pkg/cli/mcp_secrets.goAvoids fmt.Sprintf for simple command printing.
pkg/cli/mcp_server_command.goAvoids fmt.Sprintf for simple informational output.
pkg/cli/mcp_server_helpers.goUses errors.New for simple validation failures.
pkg/cli/mcp_server_http.goAvoids fmt.Sprintf for simple “Starting server” output.
pkg/cli/mcp_tools_privileged.goUses errors.As for exit errors and avoids fmt.Sprintf in jsonrpc error messages.
pkg/cli/mcp_tools_readonly.goUses errors.As for exit errors when extracting stderr.
pkg/cli/mcp_validation.goUses errors.New for “token not found” / timeouts and avoids fmt.Sprintf for simple messages.
pkg/cli/packages.goAvoids fmt.Sprintf for simple verbose output.
pkg/cli/poutine.goUses errors.As for exit errors; avoids fmt.Sprintf for docker -v arg formatting.
pkg/cli/pr_automerge.goUses strconv for PR numbers; uses errors.New for simple workflow conclusion errors; avoids fmt.Sprintf for simple info output.
pkg/cli/preconditions.goUses errors.New for simple failures; avoids fmt.Sprintf for simple output; still uses empty-message errors in a couple branches (see comments).
pkg/cli/redacted_domains.goUses errors.New("found") as a sentinel to stop walking and avoids fmt.Sprintf for simple info output.
pkg/cli/remote_workflow.goUses errors.New for invalid spec and avoids fmt.Sprintf for simple informational output.
pkg/cli/remove_command.goAvoids fmt.Sprintf for simple output lines.
pkg/cli/resolver.goAvoids fmt.Sprintf for simple error-with-suggestions message construction.
pkg/cli/run_interactive.goUses errors.New for simple guardrails; avoids fmt.Sprintf for simple “Equivalent command” output.
pkg/cli/run_workflow_execution_test.goUses errors.Is for context.Canceled assertions.
pkg/cli/run_workflow_tracking.goUses errors.New for simple “no runs found” retry errors.
pkg/cli/secret_set_command.goUses errors.New for empty secret value.
pkg/cli/secrets.goUses errors.As for exit errors; uses errors.New for “403 access denied”.
pkg/cli/signal_aware_poll.goUses errors.New for “interrupted by user”.
pkg/cli/signal_aware_poll_test.goUses errors.Is for error comparisons.
pkg/cli/spec.goUses errors.New for simple parse/validation failures.
pkg/cli/status_command.goUses errors.As for exit errors; uses errors.New for empty/invalid JSON output errors; avoids fmt.Sprintf for simple info output.
pkg/cli/tokens_bootstrap.goUses errors.New for simple “no workflow files found” error.
pkg/cli/trial_dry_run_test.goUses strconv.Itoa for PID formatting.
pkg/cli/trial_support.goAvoids fmt.Sprintf for simple verbose output.
pkg/cli/update_merge.goUses errors.As for exit errors to interpret conflicts.
pkg/cli/validation_output_test.goUses errors.New and avoids fmt.Sprintf in t.Run naming.
pkg/cli/workflows.goUses errors.As for exit errors; uses errors.New for empty/invalid JSON output; avoids fmt.Sprintf for simple success output.
pkg/cli/zizmor.goUses errors.As for exit errors and avoids fmt.Sprintf for docker args and simple output lines.
pkg/console/console.goUses strconv.Itoa to compute line-number width without fmt.Sprintf.
pkg/console/form.goUses errors.New for simple validation/TTY errors.
pkg/console/form_test.goUses errors.New for test validators.
pkg/console/input.goUses errors.New for simple validation/TTY errors.
pkg/console/input_test.goUses errors.New for test validators.
pkg/console/list.goUses errors.New for simple list/selection errors.
pkg/console/render.goUses strconv for formatting numeric/bool values where fmt.Sprintf was previously used.
pkg/console/select.goUses errors.New for no-options and non-TTY errors.
pkg/fileutil/fileutil.goUses errors.New for simple “path cannot be empty” error.
pkg/parser/frontmatter_content.goUses errors.New for “frontmatter not properly closed”.
pkg/parser/frontmatter_hash.goUses errors.New for “frontmatter not properly closed”.
pkg/parser/frontmatter_helpers_test.goUses errors.New in test update function.
pkg/parser/frontmatter_syntax_errors_test.goAvoids fmt.Sprintf for simple error message concatenation.
pkg/parser/github.goUses errors.New for missing token error message.
pkg/parser/import_cache.goUses errors.New for path validation failures.
pkg/parser/import_error.goUses errors.New for invalid chain and avoids fmt.Sprintf for simple string concatenation.
pkg/parser/import_processor.goUses errors.New for schema/validation errors and import rejection messages.
pkg/parser/json_path_locator.goUses errors.As for *jsonschema.ValidationError extraction.
pkg/parser/remote_fetch.goUses errors.New for simple parse errors and uses %w for both error values in combined failures.
pkg/parser/schema_compiler.goSimplifies schema failure message composition while maintaining multi-error formatting.
pkg/parser/schema_errors.goAvoids fmt.Sprintf where simple concatenation suffices.
pkg/parser/schema_suggestions.goAvoids fmt.Sprintf for simple suggestion prefix.
pkg/parser/workflow_update.goAvoids fmt.Sprintf for simple verbose output.
pkg/parser/yaml_import.goUses errors.New for simple validation errors.
pkg/stringutil/pat_validation.goUses errors.New for simple token format errors.
pkg/workflow/add_comment.goUses errors.New for missing config error.
pkg/workflow/add_labels.goUses errors.New for missing config error.
pkg/workflow/agent_validation.goAvoids fmt.Sprintf for simple verbose output.
pkg/workflow/agentic_output_test.goAvoids fmt.Sprintf for simple substring checks.
pkg/workflow/artifact_manager.goUses errors.New for simple validation errors.
pkg/workflow/bundler_file_mode.goAvoids fmt.Sprintf for simple heredoc delimiter prefix.
pkg/workflow/claude_engine.goUses strconv for env integer formatting and avoids fmt.Sprintf for simple YAML lines.
pkg/workflow/claude_engine_tools_test.goAvoids fmt.Sprintf when building tool strings.
pkg/workflow/claude_logs.goUses strings.Builder to avoid repeated concatenation; avoids fmt.Sprintf for unique bash naming.
pkg/workflow/claude_tools.goAvoids fmt.Sprintf when building allowed tool strings.
pkg/workflow/codex_engine.goUses strings.Builder for args concatenation and strconv for env integer formatting; avoids fmt.Sprintf for simple YAML lines.
pkg/workflow/codex_logs.goAvoids fmt.Sprintf for unique bash naming.
pkg/workflow/command.goUses errors.New for empty input and avoids fmt.Sprintf for simple string prefix creation.
pkg/workflow/command_test.goRemoves redundant := "" initialization.
pkg/workflow/compiler.goAvoids fmt.Sprintf for simple error message composition and warning output.
pkg/workflow/compiler_activation_jobs.goUses errors.New for invariant failures; uses strconv for env integer formatting; avoids fmt.Sprintf for simple YAML lines.
pkg/workflow/compiler_error_formatting_test.goUses errors.New for non-wrapping test errors.
pkg/workflow/compiler_jobs.goAvoids fmt.Sprintf for simple YAML line creation.
pkg/workflow/compiler_orchestrator_engine.goUses errors.As for import cycle errors; avoids fmt.Sprintf for simple warnings.
pkg/workflow/compiler_orchestrator_frontmatter.goFixes wrapping (%w) and uses errors.New for simple errors.
pkg/workflow/compiler_safe_outputs.goUses append([]T(nil), ...) for slice copy.
pkg/workflow/compiler_safe_outputs_steps.goFixes //nolint directive formatting to satisfy nolintlint.
pkg/workflow/compiler_string_api.goUses errors.New for “no frontmatter found”.
pkg/workflow/compiler_unlock_job.goUses errors.New for missing setup action reference error.
pkg/workflow/compiler_yaml_test.goAvoids fmt.Sprintf for simple file path creation and string concatenation.
pkg/workflow/concurrency_validation.goAvoids fmt.Sprintf for simple error message composition.
pkg/workflow/copilot_engine_execution.goUses strconv for env integer formatting and avoids fmt.Sprintf for simple YAML lines.
pkg/workflow/copilot_engine_installation.goAvoids fmt.Sprintf for simple run command string.
pkg/workflow/copilot_installer.goAvoids fmt.Sprintf for simple YAML line creation and artifact naming.
pkg/workflow/create_agent_session.goUses errors.New for missing config error.
pkg/workflow/create_code_scanning_alert.goUses errors.New for missing config error.
pkg/workflow/create_discussion.goUses errors.New for missing config error.
pkg/workflow/create_issue.goUses errors.New for missing config error.
pkg/workflow/create_pr_review_comment.goUses errors.New for missing config error.
pkg/workflow/create_pull_request.goUses errors.New for missing config error.
pkg/workflow/dependabot.goUses errors.New for simple “npm not found” / “lockfile not created” errors.
pkg/workflow/dispatch_workflow_validation.goUses errors.New for a multi-line static error message.
pkg/workflow/engine.goUses strconv to format numeric engine config values.
pkg/workflow/engine_firewall_support.goUses errors.New for strict-mode config errors.
pkg/workflow/engine_helpers.goAvoids fmt.Sprintf for simple default step naming.
pkg/workflow/engine_helpers_shared_test.goUses errors.New in simulated-error test branch.
pkg/workflow/engine_validation.goAvoids fmt.Sprintf for simple message prefixing.
pkg/workflow/error_wrapping_test.goUses errors.New where wrapping is not desired.
pkg/workflow/expression_extraction.goAvoids fmt.Sprintf for expression string construction and env var name prefixes.
pkg/workflow/expression_nodes.goAvoids fmt.Sprintf for simple ! prefix.
pkg/workflow/expression_parser.goUses errors.New for empty expression; uses strings.Builder in a quoted-string loop (see comment for remaining allocation opportunity).
pkg/workflow/expression_validation.goAvoids fmt.Sprintf for simple message concatenation.
pkg/workflow/expressions_test.goUses errors.New and errors.Is for better wrapped-error compatibility in tests.
pkg/workflow/frontmatter_extraction_yaml.goUses strconv for integer formatting.
pkg/workflow/frontmatter_types.goUses strconv for numeric-to-string conversions and errors.New for static error messages.
pkg/workflow/github_toolset_validation_error.goAvoids fmt.Sprintf for simple list item prefixes.
pkg/workflow/inputs.goUses strconv for numeric defaults formatting.
pkg/workflow/jobs.goUses errors.New for simple validation errors.
pkg/workflow/known_needs_expressions.goUses strings.Cut and uses WriteRune to avoid allocations when uppercasing.
pkg/workflow/label_trigger_parser.goUses errors.New for static parse errors.
pkg/workflow/maintenance_workflow.goUses strconv.Itoa inside generated YAML template string.
pkg/workflow/markdown_security_scanner.goAvoids fmt.Sprintf for simple finding descriptions.
pkg/workflow/mcp_gateway_mounts_test.goUses strings.Builder to avoid loop concatenation in test setup.
pkg/workflow/mcp_github_config.goUses strconv for numeric version extraction.
pkg/workflow/missing_data.goUses errors.New for missing config error.
pkg/workflow/missing_tool.goUses errors.New for missing config error.
pkg/workflow/nodejs.goAvoids fmt.Sprintf for simple YAML lines.
pkg/workflow/notify_comment.goUses WriteRune to avoid allocations when converting to upper case.
pkg/workflow/npm_validation.goAvoids fmt.Sprintf for simple verbose output.
pkg/workflow/permissions_operations.goAvoids fmt.Sprintf for simple YAML line creation.
pkg/workflow/permissions_validation.goAvoids fmt.Sprintf for simple list item prefixes.
pkg/workflow/pip_validation.goAvoids fmt.Sprintf for simple verbose output.
pkg/workflow/plugin_installation.goAvoids fmt.Sprintf for simple YAML and command strings.
pkg/workflow/plugin_installation_test.goUses strings.Builder for efficient step text building and avoids fmt.Sprintf for simple contains checks.
pkg/workflow/publish_assets.goUses errors.New for missing config error.
pkg/workflow/publish_assets_test.goUses strings.Builder for efficient step text building.
pkg/workflow/repository_features_validation.goAvoids fmt.Sprintf for gh/api args and REST path construction.
pkg/workflow/runtime_overrides.goUses strconv for numeric version formatting.
pkg/workflow/runtime_setup_test.goUses errors.New in tests and uses strings.Builder in nested loops.
pkg/workflow/runtime_step_generator.goUses strconv for numeric YAML rendering and avoids fmt.Sprintf for simple YAML lines.
pkg/workflow/runtime_validation.goAvoids fmt.Sprintf for simple verbose output.
pkg/workflow/safe_jobs.goAvoids fmt.Sprintf for simple YAML lines and path construction.
pkg/workflow/safe_outputs_config_helpers.goAvoids fmt.Sprintf for simple runs-on line creation.
pkg/workflow/safe_outputs_default_create_issue_test.goAvoids fmt.Sprintf in t.Run naming.
pkg/workflow/safe_outputs_env.goUses strconv for numeric env var value formatting.
pkg/workflow/safe_outputs_runs_on_test.goAvoids fmt.Sprintf for simple YAML substring expectations.
pkg/workflow/schedule_preprocessing.goAvoids fmt.Sprintf for simple string suffix and error message; uses errors.New for static validation error.
pkg/workflow/schema_validation.goUses errors.As for *jsonschema.ValidationError.
pkg/workflow/secrets_validation.goUses errors.New for static validation error.
pkg/workflow/shared_workflow_test.goUses errors.As for wrapped error compatibility.
pkg/workflow/slash_command_parser.goUses errors.New for static parse error.
pkg/workflow/step_order_validation.goUses errors.New for static validation error cause.
pkg/workflow/step_types.goUses errors.New for nil map error.
pkg/workflow/strings.goUses WriteRune to avoid allocations.
pkg/workflow/threat_detection.goUses errors.New for static “not enabled” error.
pkg/workflow/threat_detection_test.goUses strings.Builder for efficient step concatenation in tests.
pkg/workflow/time_delta.goUses errors.New for static parse errors.
pkg/workflow/tools_parser.goUses strconv for numeric-to-string conversions.
pkg/workflow/tools_validation.goUses errors.New for static validation errors.
pkg/workflow/validation_helpers.goUses strconv.Itoa for integer-to-string conversions in validation errors.
Comments suppressed due to low confidence (1)

pkg/cli/preconditions.go:229

  • Returning errors.New("") here produces an error with no message, which is difficult to debug and cannot be distinguished from other failures. Consider returning a descriptive error (or a named sentinel) and avoid relying on side-effect printing for error context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpkg/cli/preconditions.go Outdated
fmt.Fprintln(os.Stderr, "Contact an organization owner if you cannot change this setting.")
fmt.Fprintln(os.Stderr, "")
return fmt.Errorf("") // Error already displayed above
return errors.New("") // Error already displayed above

CopilotAIFeb 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning an error with an empty message makes it hard for callers/tests to diagnose or handle failures, even if you already printed a human-friendly message to stderr. Prefer returning a non-empty sentinel error (e.g., a package-level var) or a descriptive errors.New message (and let the caller decide whether to print).

This issue also appears on line 229 of the same file.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7451344. Replaced both errors.New("") occurrences with descriptive messages: "repository action permissions prevent agentic workflows from running" and "GitHub-owned actions are not allowed in this repository". Also restored the accidentally-consumed case "selected": label that was removed in the original edit.

Comment on lines +346 to 357
var sb strings.Builder
for i < len(expression) {
current += string(expression[i])
sb.WriteString(string(expression[i]))
if expression[i] == quote {
i++
break
}
if expression[i] == '\\' && i+1 < len(expression) {
i++ // Skip escaped character
if i < len(expression) {
current += string(expression[i])
sb.WriteString(string(expression[i]))
}

CopilotAIFeb 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new strings.Builder avoids repeated concatenations, but writing each byte via sb.WriteString(string(expression[i])) still allocates a new 1-byte string per iteration. Use sb.WriteByte(expression[i]) (and similarly for the escaped byte) to avoid per-iteration allocations and fully realize the intended performance improvement.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7451344. Replaced sb.WriteString(string(expression[i])) with sb.WriteByte(expression[i]) to avoid per-iteration allocations.

@pelikhan

Copy link
Copy Markdown
Collaborator

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

CopilotAI commented Feb 22, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot review test failures https://github.com/github/gh-aw/actions/runs/22278705885/job/64445504338

Fixed in 7451344. The CI failure was caused by a change in compiler_orchestrator_frontmatter.go where I changed %v to %w for a file read error - that change exposed os.PathError in the error chain, which TestStandardLibraryErrorsNotExposed explicitly checks should not happen. The file had a comment saying "Intentionally not wrapping to avoid exposing internal path details" which I missed. Reverted to %v with a //nolint:errorlint suppression explaining the intent.

@github-actions

github-actionsBot commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

🎬 THE ENDSmoke ClaudeMISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions

github-actionsBot commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

Copy link
Copy Markdown
Contributor

PR titles:

  • fix: use strings.Cut to resolve stringscut lint violation in known_needs_expressions
  • Normalize report formatting in org-health-report and daily-safe-outputs-conformance workflows
    GitHub MCP: ✅
    Serena MCP: ✅
    Playwright: ✅
    File write+cat: ✅
    Bash build: ✅
    Overall: PASS

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Smoke test complete for run §22279080812

Test
GitHub MCP
Safe Inputs GH CLI
Serena MCP
Playwright
File Writing
Bash Tool
Discussion Query
Build gh-aw
Discussion Creation
Workflow Dispatch
PR Review

Overall: PASS@pelikhan, @Copilot

📰 BREAKING: Report filed by Smoke Copilot

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR enables 16 new Go linters and addresses all reported issues. The changes are clean and well-organized: using errors.New for static strings, strings.Cut for simplification, and proper errors.As/errors.Is patterns. The linter additions will improve long-term code quality. LGTM!

📰 BREAKING: Report filed by Smoke Copilot

Comment thread.golangci.yml
- durationcheck # Check for two durations multiplied together
- fatcontext # Detect nested contexts in loops and function literals
- nosprintfhostport # Check for misuse of Sprintf to construct host:port URLs
- reassign # Check that package variables are not reassigned

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition of 16 new linters! The reassign linter is especially valuable for catching accidental package-level variable reassignments. Consider adding a brief comment block grouping these into categories (e.g., "performance", "correctness", "style") to make future maintenance easier.

Comment threadcmd/gh-aw/main.go
// Check if running in CI environment
if cli.IsRunningInCI() {
return fmt.Errorf("interactive mode cannot be used in CI environments. Please provide a workflow name")
return errors.New("interactive mode cannot be used in CI environments. Please provide a workflow name")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of errors.New instead of fmt.Errorf for static error strings — this is exactly what the perfsprint linter enforces and avoids unnecessary allocations. 👍

@github-actions

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

Copy link
Copy Markdown
Contributor

✅ Commit pushed: 9126b45

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test results for run §22279080836:

Core tests (#1-10): ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
PR review tests (#11-17): ✅ ✅ ✅ ⚠️ ✅ ✅ ⚠️

Overall: PARTIAL (2 skipped: no review threads to resolve, no test PR to close)

💥 [THE END] — Illustrated by Smoke Claude

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude

@pelikhan
pelikhan merged commit dce6f84 into mainFeb 22, 2026
@pelikhan
pelikhan deleted the copilot/enable-more-go-linters branch February 22, 2026 14:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@pelikhan