Adds new lint rule to detect test overlap in web feature files#58827
Draft
ChrisC wants to merge 3 commits intoweb-platform-tests:masterfrom
Draft
Adds new lint rule to detect test overlap in web feature files#58827ChrisC wants to merge 3 commits intoweb-platform-tests:masterfrom
ChrisC wants to merge 3 commits intoweb-platform-tests:masterfrom
Conversation
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.
Adds a new
OVERLAPPING-WEB-FEATURES-FILElint rule that detects when the same test file is mapped to multiple features within a singleWEB_FEATURES.ymlfile. (Overlap detection is file-based, not pattern-based: patterns are resolved to actual filenames first, so intentional exclusion patterns do not accidentally trigger the error.)Error message design
Errors are grouped one per overlapping feature pair rather than one per overlapping file. This keeps output manageable in cases where many files are shared between two features. The message lists up to the first 5 overlapping filenames, followed by "and N more" for larger overlaps. Example:
Silencing intentional overlaps
Authors who intentionally map the same test to multiple features (e.g. a test of two closely related features) can suppress this error using the existing lint.ignore mechanism:
OVERLAPPING-WEB-FEATURES-FILE: path/to/WEB_FEATURES.yml(One downside of this approach is that it will be hard to selectively ignore specific overlaps within a single
WEB_FEATURE.yml. It's possible that some future updates to theWEB_FEATURES.ymlschema could more expressively address situations where overlap is intended.)Existing overlaps
Currently, there are 57
WEB_FEATURES.ymlfiles in the repo that already have overlapping mappings. For simplicity, I'm just assuming those are all intentional for now, and have added them tolint.ignore. So this PR introduces no new lint failures. Happy to revisit this added IGNORE list either in this PR or in a follow-up PR.