refactor: canonicalize internal metadata field names
Problem: `pending.Metadata` used shorthand field names (`cat`, `rec`, `rec_mode`) matching user-facing token syntax, coupling internal representation to config. `RecurSpec.from_completion` used a boolean where a `pending.RecurMode` alias exists. `category_syntax` was hardcoded to `'cat'` with no config option. Solution: rename `Metadata` fields to `category`/`recur`/`recur_mode`, add `category_syntax` config option (default `'cat'`), rename `ParsedEntry` fields to match, replace `RecurSpec.from_completion` with `mode: pending.RecurMode`, and restore `[string]` indexer on `pending.ForgeConfig` alongside explicit fields.
This commit is contained in:
parent
4710e6197f
commit
05871fa1a5
12 changed files with 96 additions and 67 deletions
|
|
@ -404,7 +404,7 @@ describe('forge parse.body integration', function()
|
|||
it('extracts category but keeps forge ref in description', function()
|
||||
local desc, meta = parse.body('Fix bug gh:user/repo#42 cat:Work')
|
||||
assert.equals('Fix bug gh:user/repo#42', desc)
|
||||
assert.equals('Work', meta.cat)
|
||||
assert.equals('Work', meta.category)
|
||||
end)
|
||||
|
||||
it('leaves non-forge tokens as description', function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue