Skip to content

v2.31.2

Choose a tag to compare

@github-actions github-actions released this 15 Nov 06:11
· 12 commits to main since this release

Fixes

  • PowerShell command lines are quoted and split with PowerShell rules. The PowerShell shell inherited the POSIX quoting and splitting of the generic shell, which broke single quotes and absolute Windows paths:

    • Quoting a corrected command for --repeat or a git alias expansion used the shlex '"'"' escape. PowerShell does not concatenate adjacent string literals, so it parsed that as several arguments and a correction such as git commit -m 'hello' was broken. PowerShell single quoted strings with doubled quotes now round-trip exactly.
    • Splitting treated the backslash as an escape character, so a Windows path lost its backslashes. Rules that compare the path of the command line with the path in the error message never matched an absolute path: cat C:\Windows reported no suggestion instead of ls C:\Windows. cat, gc, type and Get-Content on absolute Windows paths (quoted or not) now get the ls suggestion, and the same fix covers the other rules that parse arguments, including the history based rules.

Verification

  • Full test suite, gofmt, go vet, staticcheck and the rule list check pass; the new tests compare the splitter and the quoting round-trip against a real Windows PowerShell 5.1, and the rule test covers an absolute Windows path.
  • CI is green on Linux, macOS and Windows with lint and the 94% coverage gate; live checks with an isolated configuration directory confirm the four absolute path scenarios and that relative paths still work.
  • Distribution manifests are regenerated for 2.31.2 and the AUR package is published as 2.31.2-1.

Upgrade

Homebrew, Scoop and AUR update through their package managers; go install github.com/leafevans/go-fuck/v2/cmd/go-fuck@latest picks up 2.31.2.

Changelog

  • cf3fef0: fix(powershell): quote and split command lines with PowerShell rules (@leafevans)

Full Changelog: v2.31.1...v2.31.2