Skip to content

bash-format: fallback drops --apply-ignore, bare [*] .editorconfig section treated as shell opt-in, openBinaryFile failures on Windows paths #1817

Description

@kyle-sexton

Three defects observed in the bash-format plugin hook (2026-07-30, Windows host)

  1. Fallback discards --apply-ignore. The hook runs shfmt --apply-ignore -w "$FILE" 2>/dev/null || shfmt -w "$FILE" 2>/dev/null. When the first call fails for any reason, the fallback re-formats WITHOUT --apply-ignore, so a repo's .editorconfig [*.sh] ignore = true is intermittently discarded and files get re-tabbed to shfmt defaults. Verified shfmt --apply-ignore -w standalone (v3.13.1) is a correct no-op with the opt-out in place — only the fallback defeats it.
  2. Bare [*] section reads as a shell opt-in. shell_editorconfig_opt_in contains [[ "$h" == '*' ]] && return 0, so any repo with a generic .editorconfig (most repos) is opted into shfmt formatting regardless of intent.
  3. openBinaryFile: does not exist (No such file or directory) raised intermittently by the shellcheck and typos hook invocations on Windows paths — looks like the same path-handling class.

Where observed

kyle-sexton/autonomy-demo-scratch PR #67 babysit worker run; the worker had to land its final shell file via cp because the hook kept re-tabbing it through the fallback path.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions