Skip to content

gherkin-to-asciidoc-indexing-force-rewrite - #104

Merged
Arc-E-Tect merged 2 commits into
mainfrom
gherkin-to-asciidoc-indexing-force-rewrite
Aug 9, 2026
Merged

gherkin-to-asciidoc-indexing-force-rewrite#104
Arc-E-Tect merged 2 commits into
mainfrom
gherkin-to-asciidoc-indexing-force-rewrite

Conversation

@Arc-E-Tect

Copy link
Copy Markdown
Owner

No description provided.

Arc-E-Tect and others added 2 commits August 5, 2026 18:04
…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>
@Arc-E-Tect Arc-E-Tect self-assigned this Aug 9, 2026
@Arc-E-Tect Arc-E-Tect added the bug Something isn't working label Aug 9, 2026
@Arc-E-Tect Arc-E-Tect closed this Aug 9, 2026
@Arc-E-Tect Arc-E-Tect reopened this Aug 9, 2026
@Arc-E-Tect
Arc-E-Tect merged commit dbe32b7 into main Aug 9, 2026
5 checks passed
@Arc-E-Tect
Arc-E-Tect deleted the gherkin-to-asciidoc-indexing-force-rewrite branch August 9, 2026 14:50
@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant