fix(docs): remove obsolete CLI reference pages after generation
Metadata
Current evaluation
Merged PR #5572 (commit a281e0362) added CLI docs generator cleanup, deleting obsolete command .rst files after regeneration and resolving #5200.
Resolution: closed resolved
Reason: PR #5572 was approved and merged as commit a281e0362. It now compares generated command pages with existing files and removes stale .rst files, preventing unresolvable toctree errors.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [x] I have followed the [contributing guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md).
- [x] I have signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [x] I have successfully run `make lint`.
- [x] I have successfully run `make test`.
This PR fixes an issue where obsolete CLI documentation files (`.rst`) under `docs/reference/commands/` were not removed after regeneration.
Obsolete command pages could persist after a build, causing errors such as:
document isn't included in any toctree
This change ensures old `.rst` files are deleted if their corresponding commands are no longer present.
Closes #5200
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #5572 (commit a281e0362) added CLI docs generator cleanup, deleting obsolete command .rst files after regeneration and resolving #5200. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged the fix to delete obsolete command .rst files during CLI documentation generation, preventing orphaned pages and toctree errors. Closes canonical/snapcraft#5200. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix that automatically removes obsolete CLI documentation files after regeneration, preventing build errors. Approved by reviewers, passed CI checks, and closed the related issue. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to close issue #5200. The change deletes obsolete CLI reference pages after generation to prevent toctree errors. The contributor updated setup instructions per reviewer feedback, passed lint and tests, and the fix was integrated. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/snapcraft#5200
(confidence 100%)
PR #5572 explicitly closes the stale CLI reference page issue and implements cleanup in the docs generator.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5200 Reference docs for removed commands persist between builds | snapcraft | closed | Closed as stale; later PR #5572 (commit a281e0362) added cleanup of obsolete generated command pages in gen_cli_docs.py. |