mirror of
https://github.com/harivansh-afk/forge.nvim.git
synced 2026-04-15 06:04:41 +00:00
docs: add compatibility matrix and capabilities to vimdoc
Problem: vimdoc did not document per-forge feature differences or the new capabilities field on the forge interface. Solution: add COMPATIBILITY section with per-forge feature matrix, document `capabilities` in the `forge.Forge` interface fields, and update the source skeleton example.
This commit is contained in:
parent
2af47b6cf4
commit
27c41d2f71
1 changed files with 42 additions and 7 deletions
|
|
@ -411,6 +411,30 @@ Sources are lazy-loaded the first time a matching remote is detected. Built-in
|
||||||
host patterns are checked after user-configured `sources` hosts, so user
|
host patterns are checked after user-configured `sources` hosts, so user
|
||||||
overrides take priority.
|
overrides take priority.
|
||||||
|
|
||||||
|
COMPATIBILITY ~
|
||||||
|
*forge-compatibility*
|
||||||
|
Not all features are available on every forge. The table below shows per-forge
|
||||||
|
support for features that vary:
|
||||||
|
|
||||||
|
Feature GitHub GitLab Codeberg ~
|
||||||
|
PR list/filter yes yes yes
|
||||||
|
PR create yes yes yes
|
||||||
|
PR create (draft) yes yes -
|
||||||
|
PR create (reviewers) yes yes -
|
||||||
|
PR draft toggle yes yes -
|
||||||
|
Per-PR CI checks yes - -
|
||||||
|
CI runs (repo-wide) yes yes yes
|
||||||
|
Issues yes yes yes
|
||||||
|
Browse/Yank yes yes yes
|
||||||
|
|
||||||
|
Features marked `-` are unavailable due to CLI limitations. When a feature is
|
||||||
|
unsupported, forge.nvim either hides the option (draft and reviewer fields in
|
||||||
|
the compose buffer) or falls back gracefully (per-PR checks redirects to
|
||||||
|
repo-wide CI with a notification).
|
||||||
|
|
||||||
|
Each source declares its capabilities in a `capabilities` table. See
|
||||||
|
|forge-Forge-interface|.
|
||||||
|
|
||||||
HOST OVERRIDES ~
|
HOST OVERRIDES ~
|
||||||
*forge-sources-hosts*
|
*forge-sources-hosts*
|
||||||
To route a self-hosted instance to a built-in source: >lua
|
To route a self-hosted instance to a built-in source: >lua
|
||||||
|
|
@ -436,13 +460,18 @@ A source must implement all methods in the `forge.Forge` class. Each source is
|
||||||
a table with these fields and methods:
|
a table with these fields and methods:
|
||||||
|
|
||||||
Fields: ~
|
Fields: ~
|
||||||
`name` `string` Source name (e.g. `"github"`).
|
`name` `string` Source name (e.g. `"github"`).
|
||||||
`cli` `string` CLI executable name (e.g. `"gh"`).
|
`cli` `string` CLI executable name (e.g. `"gh"`).
|
||||||
`kinds` `table` `{ issue = string, pr = string }` -- CLI
|
`kinds` `table` `{ issue = string, pr = string }` -- CLI
|
||||||
subcommand names for issues and PRs.
|
subcommand names for issues and PRs.
|
||||||
`labels` `table` `{ issue = string, pr = string,`
|
`labels` `table` `{ issue = string, pr = string,`
|
||||||
`pr_one = string, pr_full = string,`
|
`pr_one = string, pr_full = string,`
|
||||||
`ci = string }` -- display labels.
|
`ci = string }` -- display labels.
|
||||||
|
`capabilities` `table` Feature flags (see |forge-compatibility|):
|
||||||
|
`draft` Create/toggle draft PRs.
|
||||||
|
`reviewers` Assign reviewers on create.
|
||||||
|
`per_pr_checks` CI checks scoped to a PR.
|
||||||
|
`ci_json` Structured CI run data.
|
||||||
|
|
||||||
Required methods: ~
|
Required methods: ~
|
||||||
|
|
||||||
|
|
@ -521,6 +550,12 @@ Skeleton: >lua
|
||||||
pr_full = 'Pull Requests',
|
pr_full = 'Pull Requests',
|
||||||
ci = 'CI/CD',
|
ci = 'CI/CD',
|
||||||
},
|
},
|
||||||
|
capabilities = {
|
||||||
|
draft = false,
|
||||||
|
reviewers = false,
|
||||||
|
per_pr_checks = false,
|
||||||
|
ci_json = false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function M:list_pr_json_cmd(state)
|
function M:list_pr_json_cmd(state)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue