INTL-1674: Start at fixing the constant migrator's date format detection #253
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.
Motivation
In attempting to work on something else I put in a constant of the form
const migrateMe = 'migrate me';
into a file, and then wondered why it wasn't getting migrated. Which led me to realize that the boolean expression for avoiding strings like 'MM/dd/yy' was incorrect. So I fixed it, and then realized that it broke a different test, where we screen out strings like 'probably-not' which are, we guess, maybe CSS selectors. But that's not great because it's possible if, um, 'un-likely' to have user-visible strings like that. So if we just fix this logic then it might start picking up other strings we didn't want. And it looks like we don't really actually have any logic for screening those out, though I could have sworn we did. There's some stuff in utils for filtering out pure camelCase alphabetics, but I didn't see this.
Also, the logic here is still questionable, because date formats don't necessarily start with upper case. We'd almost be equally well off just looking for an 'MM/' prefix.
Anyway, I'm leaving this for the moment, but left the code in place for posterity.
Changes
Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: