You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[plan] Codemod: auto-rewrite single-quoted args in bash tool list entries #31845
Add a codemod that rewrites bash tool list entries containing single-quoted arguments (e.g. grep -rn 'pattern') into double-quoted or POSIX-safe form to prevent silent truncation.
Context
From compatibility audit issue #31667. Observed in YousefHadder/markdown-plus.nvim with 40 occurrences. Bash tool list entries with single-quoted arguments (e.g. grep -rn 'pattern' --include='*.lua') are silently truncated to a prefix (e.g. grep -rn) for shell prefix-matching. Users lose precision they believe they configured.
Approach
Find where bash tool list entries are parsed and where truncation occurs (search for bash tools/tool-list parsing and the single-quote warning in pkg/workflow/ and pkg/parser/)
Add a codemod in the gh aw fix pipeline that:
Scans tools.bash list entries in frontmatter
Detects entries with embedded single quotes (e.g. grep -n 'foo')
Rewrites them to a form that survives the parser without truncation — either:
Double-quoted equivalent: grep -n "foo"
Or strips the quoted argument if no safe rewrite exists, emitting a warning
Prioritize exact round-trip correctness; if a rewrite would change semantics, emit a warning and leave the entry unchanged
Add tests covering: simple single-quote rewrite, glob patterns like *.lua, no-op for already-safe entries
Files to Investigate
pkg/workflow/ or pkg/parser/ — bash tool parsing, single-quote warning
pkg/cli/fix_command.go — codemod entry point
Search for the warning message text about single quotes to find the parsing location
Acceptance Criteria
gh aw fix --write rewrites single-quoted bash tool entries to double-quoted or safe form
Compiler no longer emits the single-quote truncation warning for rewritten entries
Entries that cannot be safely rewritten are left unchanged with a diagnostic
Activity