Skip to content

feat: add format-command input for a user formatting hook - #120

Merged
c-vigo merged 3 commits into
devfrom
feature/17-format-command
Jul 16, 2026
Merged

c-vigo merged 3 commits into
devfrom
feature/17-format-command

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Implements the format-command design approved for #17 (chosen over a hook-script convention, a run-pre-commit boolean, and docs-only).

  • New optional format-command input: a shell command the action runs on the synced files after they are written and before outputs are set, so the downstream commit step picks up formatted files.
  • Every {files} placeholder is replaced with the shell-quoted modified paths (single-quote escaping covers spaces/metacharacters); a command without a placeholder runs as-is.
  • Skipped when the input is empty or nothing changed; a failing command fails the action with format-command failed: … context.

TDD: failing spec committed first (6 new unit tests — placeholder substitution, quoting, skip conditions, error wrapping), then the implementation, then docs (action.yml, README inputs table, changelog) + rebuilt dist/. 121/121 tests, full hook suite green.

Refs: #17

c-vigo added 3 commits July 16, 2026 17:21
Specifies the format-command contract: skip on empty command or empty
file list, substitute every {files} placeholder with shell-quoted
paths, run placeholder-free commands as-is, and wrap execution errors
with format-command context.

Refs: #17
Runs a consumer-supplied shell command after synced markdown files are
written and before outputs are set, so the downstream commit step picks
up formatted files. Every {files} placeholder is replaced with the
shell-quoted modified paths; commands without a placeholder run as-is.
Skipped when the input is empty or no files changed; failures fail the
action with format-command context.

Refs: #17
@c-vigo c-vigo added this to the 0.4 milestone Jul 16, 2026
@c-vigo c-vigo added feature New feature or request area:workflow Developer workflow, commands, rules, skills labels Jul 16, 2026
@c-vigo
c-vigo merged commit 630ec60 into dev Jul 16, 2026
22 checks passed
@c-vigo
c-vigo deleted the feature/17-format-command branch July 16, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workflow Developer workflow, commands, rules, skills feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant