Repository navigation
fix(tags): report a tags.yaml that cannot be read instead of a missing one - #2061
Conversation
|
No confident findings in the specified diff. The PR description includes failing-first evidence, passing unit tests, type checking, targeted lint, and a representative isolated real-CLI run showing exit 1 for malformed Review was read-only; no PR code was run, built, or installed. |
|
Blocked for now, with a precise reason: #2047 just merged, and it adds the same two imports to A rebase that drops this branch's duplicate import lines resolves it. The |
…g one tags list read a null load as a missing file, so a tags.yaml that does not parse was reported as 'not configured yet' with exit 0, after the loader had printed the parse error. It now names the file and exits 1; only a missing file keeps the 'not configured yet' message. Refs Tencent#2046
823e39c to
79a5284
Compare
|
Rebased onto Verified on the rebased tree: The |
|
No confident findings in the specified diff. The PR description documents failing-first evidence, passing unit tests, type checking, targeted lint, and a representative isolated real-CLI run confirming malformed The earlier review reported no findings, so none require resolution. Review was read-only; no PR code was run, built, or installed. |
Summary
Fixes #2056 (the
tags listhalf of #2046).tagsListsaw anullfromloadTagsConfigand printedNo tags.yaml found in team repo. Tags are not configured yet.— but that function returnsnullboth for a missing file and for one that does not parse. A team with a brokentags.yamlwas therefore told it had no tags, after the loader had printed the parse error, and the command exited 0. It now names the file and exits 1; only a missing file keeps the "not configured yet" message.Changes
src/tags.ts:tagsListcheckspathExists(<repo>/tags.yaml)when the load returnsnull; an existing file that did not load is reported withlog.error(...)andprocess.exitCode = 1.src/__tests__/tags-cmd.test.ts: new case in the existingtags listdescribe block (malformedtags.yaml→ error naming the file, no "No tags.yaml found" line, exit 1); the block now resetsprocess.exitCodearound each test.Testing
Failing first on
main(6911c22):After the fix:
Real CLI
npm run verify:worldis not supported on this Windows host, so I ran the builtdist/index.jsfrom an empty temp project under an isolatedHOMEwithenv -i. Windows 11 build 26100, Node v22.19.0.Before (built from
6911c22):After:
A team repo with no
tags.yamlstill prints the old message and exits 0.Surfaces
tagsListresolves the scope before reading (resolveTagsScope), so user and project scope behave the same; the real-CLI record uses user scope.tags.yamlin every mode; no provider path is involved.tags listcommand (andtagswith no subcommand); no workflow step lists tags.skill-data/: usage and flags are unchanged, so no doc edit.npm run lintandcheck-docsfail on this host only for pre-existing Windows defects (fix(lint): resolve the plugin's rule scopes with/on every platform #1967 CRLF, fix(lint): ignore CRLF in shipped driver comparisons #1942), so lint was run on the two changed files.