Skip to content

Update documentation paths on major bumps with ignore-next-line support - #37

Merged
bcomnes merged 6 commits into
masterfrom
feat/major-documentation-paths
Oct 7, 2026
Merged

bcomnes merged 6 commits into
masterfrom
feat/major-documentation-paths

Conversation

@bcomnes

@bcomnes bcomnes commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner
  • Update self-referential pkg.go.dev/godoc.org links, badges, example imports, and installation commands in Markdown and Go comments when goversion major changes the module path.

  • Preserve anchors, query parameters, pinned versions, other major paths, unrelated URLs, and runtime string literals; let @latest follow the new module path.

  • Add <!-- goversion:ignore-next-line --> for Markdown and standalone // goversion:ignore-next-line comments for Go documentation. Preserve the next physical line without suppressing actual import or go.mod updates.

  • Share documentation discovery between dry runs and real bumps, deduplicate affected paths, and include rewritten docs in the version commit automatically.

  • Share Git-aware discovery across import and documentation scans. Prune directories containing no tracked or nonignored files before descent, including fully ignored node_modules and build trees; retain tracked files and ignore-rule exceptions. Always skip nested modules, vendor directories, Git internals, and symlinks.

  • Stage tracked updates separately so tracked docs inside ignored directories remain supported without force-adding build output.

  • Document the behavior and directive with before/after links and examples. Existing module migration remains limited to the major directive; explicit versions and premajor are unchanged.

  • Add regression tests for version/path boundaries, Markdown formatting, Go comments, CRLF preservation, ignored files, directives, and dry-run/commit parity. Include test-file imports in dry-run reporting.

  • Verified go test ./..., go test -race ./..., go vet ./..., go build ./..., and git diff --check.

  • Add -skip-docs and VersionOptions.SkipDocs to disable automatic documentation rewriting and its dry-run reporting while retaining module-path updates, self-import rewriting, explicit bump files, and post-bump hooks. Cover the flag through CLI, library, and hook integration tests.

Rewrite self-referential documentation URLs, badges, examples, and Go comments alongside major module path updates. Preserve version pins and unrelated references, and support goversion:ignore-next-line for intentional cross-major documentation links. Keep dry-run reporting and automatic staging aligned with the rewritten files.
@bcomnes
bcomnes requested a balanced review from Copilot October 6, 2026 23:29
@bcomnes
bcomnes marked this pull request as ready for review October 6, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

References to nested modules can be incorrectly rewritten as packages of the bumped module.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds automatic documentation-reference migration during major module-version bumps.

Changes:

  • Rewrites Markdown and Go-comment module references.
  • Adds ignore-next-line directives and regression coverage.
  • Includes rewritten documentation in dry runs and commits.
File Description
README.md Documents migration behavior and directives.
pkg/​goversion.go Integrates discovery, rewriting, staging, and reporting.
pkg/​documentation.go Implements documentation rewriting and filtering.
pkg/​documentation_test.go Tests rewriting and major-bump integration.
pkg/​documentation_directive_test.go Tests ignore directives and line endings.
pkg/​doc.go Updates package-level API documentation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/documentation.go Resolved
Share Git-aware file discovery across documentation and import rewriting. Build scan eligibility from tracked and nonignored files so ignored dependency and build directories are not traversed, while tracked files and ignore exceptions remain eligible.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Broad documentation rewriting and release-staging changes warrant final human validation despite strong regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@bcomnes
bcomnes added this pull request to stack #39 October 7, 2026 00:06
@bcomnes
bcomnes merged commit abcbd00 into master Oct 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants