gherkin-to-asciidoc-indexing-force-rewrite - #104
Merged
Conversation
…ady-numbered lines Adds a forceRewrite DSL property (default false) and matching -PgherkinToAsciidoc.forceRewrite CLI override. When false, a Feature/Scenario line whose existing number already matches the format the currently configured indexing value would itself produce is left completely untouched; only lines not yet correctly numbered for that mode are numbered. A newly added feature file that sorts alphabetically before already-numbered files is given the next number not already in use, rather than bumping every file after it. A number left over from a *different* indexing value still doesn't "reflect" the current one, so it's stripped and replaced as before - e.g. switching from SCENARIO to ALL renumbers old single-integer scenario numbers to the new <featureNumber>.<n> format. OFF still always strips every number regardless of forceRewrite, since OFF's canonical state for every line is unnumbered. Rewrites FeatureIndexer around a two-phase parse-then-resolve model (collect every Feature/Scenario line first, then resolve numbers - pinned or freshly assigned - before rewriting any file) to support this; forceRewrite = true restores the previous single-pass strip-then-renumber-everything behaviour unchanged. BREAKING CHANGE: indexing's default numbering behaviour changes. Previously every generateFeatureDocs run fully renumbered every Feature/Scenario from scratch; by default it now preserves numbers that already match the current indexing value's format instead. Set forceRewrite = true (or -PgherkinToAsciidoc.forceRewrite=true) to keep the old always-renumber-everything behaviour. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner
Author
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.