Repository navigation
fix(layout): codemod doc catch-up and regex quote forms (#862) - #1363
Merged
Merged
Conversation
Regex source-text assertions written with a quote class (['"] or ["']) or a \x27/\x22 escape now warn like plain quoted ones; the fts-match assertions in test/db-search-query-bound.test.js were missed before. docs/module-moves.md still described the first-round excerpt warnings. It now matches the scanner: excerpts warn only when their source requires a moved module or a stubbed key, extract* results that reach vm are full loads, skipped path.join segments and regex/template text warn, and an assertion on a moved module's require of a module that stays put does not.
Decoding the pattern text ignored character-class context: a class such as [\x27.\/a\x27] or [^\x27.\/a\x27] matches one character but was read as the literal './a' and warned. Mixed delimiters such as ['"]...\x22 were missed because the two quotes decoded differently and the matcher pairs identical quotes. Regex patterns are now tokenised: every quote form and every class made only of quote forms becomes one canonical quote, escaped non-word characters read as themselves, and any other class or escape is opaque.
…#862) Uppercase \X is an identity escape, so \X27 is not a quote.
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.
Closes #862. This is a prerequisite of #1357, which finishes the ADR 0005 module moves.
Change
scripts/move-modules.jsnormalises them before it matches source text. Each of these now reaches the source-text warning, with one test per form:['"]and["']classes;\x27and\x22;test/db-search-query-bound.test.jswithfts-match.jsmoved now warns at :46 and :60.docs/module-moves.mdnow describes the current warnings, the same as the code. It adds the note that a test asserting a moved module'srequireof a module that stays put gets no warning.Docs
docs/module-moves.md..ai/contexts/module-moves.md.Changelog
no-changelog: tooling users do not see.Tests
test/move-modules.test.jstest/module-layout.test.jsscripts/check-doc-refs.jsNot covered:
\u0027/\u0022and quote classes with more members.