feat(forge): add validate option for forge ref validation on write (#138)

Problem: Typos in forge refs like `gh:user/repo#42` silently persist —
there's no feedback when a ref points to a nonexistent issue.

Solution: Add `forge.validate` config option. When enabled, `diff.apply()`
returns new/changed `ForgeRef[]` and `forge.validate_refs()` fetches
metadata for each, logging specific warnings for not-found, auth, or
CLI-missing errors.
This commit is contained in:
Barrett Ruth 2026-03-11 12:23:20 -04:00
parent 494e26d7a1
commit a4f782a5fb
6 changed files with 163 additions and 19 deletions

View file

@ -1501,6 +1501,7 @@ Configuration: ~
vim.g.pending = {
forge = {
close = false,
validate = false,
warn_missing_cli = true,
github = {
icon = '',
@ -1525,6 +1526,10 @@ Top-level fields: ~
{close} (boolean, default: false) When true, tasks linked to
closed/merged remote issues are automatically marked
done on buffer open.
{validate} (boolean, default: false) When true, new or changed
forge refs are validated on `:w` by fetching metadata.
Logs a warning if the ref is not found, auth fails, or
the CLI is missing.
{warn_missing_cli} (boolean, default: true) When true, warns once per
forge per session if the CLI is missing or fails.