Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cli/actionlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func runActionlintOnFiles(lockFiles []string, verbose bool, strict bool) error {
}

// Get relative paths from git root for all files
var relPaths []string
relPaths := make([]string, 0, len(lockFiles))
for _, lockFile := range lockFiles {
relPath, err := filepath.Rel(gitRoot, lockFile)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/add_interactive_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (c *AddInteractiveConfig) selectAIEngineAndKey() error {
// Build engine options with notes about existing secrets and workflow specification.
// The list of engines is derived from the catalog to ensure all registered engines appear.
catalog := workflow.NewEngineCatalog(workflow.NewEngineRegistry())
var engineOptions []huh.Option[string]
engineOptions := make([]huh.Option[string], 0, len(catalog.All()))
for _, def := range catalog.All() {
opt := constants.GetEngineOption(def.ID)
label := fmt.Sprintf("%s - %s", def.DisplayName, def.Description)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_bash_anonymous.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func getBashAnonymousRemovalCodemod() Codemod {

// replaceBashAnonymousWithTrue replaces 'bash:' with 'bash: true' in the tools block
func replaceBashAnonymousWithTrue(lines []string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inToolsBlock bool
var toolsIndent string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_discussion_flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func getDiscussionFlagRemovalCodemod() Codemod {
}

newContent, applied, err := applyFrontmatterLineTransform(content, func(lines []string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inSafeOutputsBlock bool
var safeOutputsIndent string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_expires_integer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func getExpiresIntegerToStringCodemod() Codemod {
// convertExpiresIntegersToDayStrings converts integer expires values to day strings within safe-outputs blocks.
// Only affects expires lines nested inside a safe-outputs block.
func convertExpiresIntegersToDayStrings(lines []string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inSafeOutputsBlock bool
var safeOutputsIndent string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_github_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func hasDeprecatedAppField(frontmatter map[string]any) bool {

// renameAppToGitHubApp renames 'app:' to 'github-app:' within tools.github, safe-outputs, and checkout blocks.
func renameAppToGitHubApp(lines []string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
modified := false

// Block tracking
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_mcp_mode_to_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func getMCPModeToTypeCodemod() Codemod {

// renameModeToTypeInMCPServers renames 'mode:' to 'type:' within mcp-servers blocks
func renameModeToTypeInMCPServers(lines []string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inMCPServers bool
var mcpServersIndent string
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/codemod_mcp_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func getMCPNetworkMigrationCodemod() Codemod {

// removeFieldFromMCPServer removes a field from a specific MCP server configuration
func removeFieldFromMCPServer(lines []string, serverName string, fieldName string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inMCPServers bool
var mcpServersIndent string
Expand Down Expand Up @@ -283,7 +283,7 @@ func addTopLevelNetwork(lines []string, domains []string) []string {

// updateNetworkAllowed updates the existing top-level network.allowed configuration
func updateNetworkAllowed(lines []string, domains []string) []string {
var result []string
result := make([]string, 0, len(lines))
var inNetworkBlock bool
var networkIndent string
var inAllowedBlock bool
Expand Down Expand Up @@ -359,7 +359,7 @@ func updateNetworkAllowed(lines []string, domains []string) []string {

// addAllowedToNetwork adds an allowed field to an existing network block
func addAllowedToNetwork(lines []string, domains []string) []string {
var result []string
result := make([]string, 0, len(lines))
var inNetworkBlock bool
var networkIndent string
var insertIndex = -1
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_playwright_domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func getPlaywrightDomainsCodemod() Codemod {

// removeFieldFromPlaywright removes a field from the tools.playwright block (two-level nesting)
func removeFieldFromPlaywright(lines []string, fieldName string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inTools bool
var toolsIndent string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_safe_inputs_to_mcp_scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func getSafeInputsToMCPScriptsCodemod() Codemod {

// renameTopLevelKey renames a top-level YAML key from oldKey to newKey, preserving formatting.
func renameTopLevelKey(lines []string, oldKey, newKey string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
applied := false

for _, line := range lines {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_serena_local_mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func getSerenaLocalModeCodemod() Codemod {
// replaceSerenaLocalModeWithDocker replaces 'mode: local' with 'mode: docker' within the
// tools.serena block in frontmatter lines.
func replaceSerenaLocalModeWithDocker(lines []string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inTools bool
var toolsIndent string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/codemod_yaml_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func applyFrontmatterLineTransform(content string, transform func([]string) ([]s
// removeFieldFromBlock removes a field and its nested content from a YAML block
// Returns the modified lines and whether any changes were made
func removeFieldFromBlock(lines []string, fieldName string, parentBlock string) ([]string, bool) {
var result []string
result := make([]string, 0, len(lines))
var modified bool
var inParentBlock bool
var parentIndent string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/run_interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func collectInputsWithMap(inputs map[string]*workflow.InputDefinition) ([]string
}

// Collect the final values from the pointers
var result []string
result := make([]string, 0, len(inputPtrs))
for name, valuePtr := range inputPtrs {
value := *valuePtr
if value != "" {
Expand Down