enhance(scripts/diff-flat): detect moves#29561
Draft
caugner wants to merge 5 commits into
Draft
Conversation
Contributor
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
Project each detected move's `__compat` from its source path onto the destination path in the base tree before flattening, so a pure rename produces zero diff output beyond the moves listing. Real edits inside a moved feature still surface, anchored to the new path.
…ords Add a fallback pass to `detectMoves` for features without `spec_url` or `mdn_url`. Score each candidate by common-ancestor depth (primary) plus inverse-frequency-weighted shared leaf tokens (secondary). Tokens that appear in more than half of unmatched removed or added features are treated as scaffolding (e.g. `init`, `parameter`) and ignored. Catches renames like `api.fetch.init_keepalive_parameter` → `api.fetch.options_parameter.keepalive` that pass 1 misses for lack of a spec URL.
| } | ||
| node = node[parts[i]]; | ||
| } | ||
| node[parts[parts.length - 1]] = value; |
| const rendered = formatMove(from, to, options); | ||
| const visibleLen = | ||
| options.format === 'html' | ||
| ? rendered.replace(/<[^>]+>/g, '').length |
This was referenced Apr 30, 2026
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.
Summary
Enhance the
diff-flatscript to detect feature moves.Test results and supporting details
Related issues
Triggered by #29451.