Repository navigation
Make unmatched ignoreErrors entries without a path fixable - #6923
Merged
Merged
Conversation
An unmatched entry without a path, a plain string pattern, or an entry with an fnmatch path pattern used to be reported as a message that is not specific to any file, and so it could not be fixed. It is now reported as ignore.unmatched in the config file, on the line of the entry, and --fix removes it like the path-specific ones. A too high count of such an entry can be lowered too. The entry stays a plain message when it is not found in the config files, e.g. in a config file of an installed Composer package, or when it has `paths` with some of them matched. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a0da-23d4-77fd-aee3-a6a5a4016baf
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.
An unmatched
ignoreErrorsentry without a path, likewas reported as a message that is not specific to any file (
Ignored error "..." was not matched in reported errors.), so--fixcould not remove it, unlike path-specific unmatched entries.It is now reported as
ignore.unmatchedin the config file, on the line of the entry, and--fixremoves it. This covers entries without a path in PHP and NEON config files, plain string patterns (- '#pattern#'), and entries with an fnmatchpath. A too highcountof such an entry can be lowered too.The entry stays a plain message when it is not found in the config files, e.g. in a config file of an installed Composer package, or when it has
pathswith some of them matched.Tested by
IgnoreErrorsConfigFixerTestand by thee2e/fix-baselinescenario, which now has two entries without a path in the NEON baseline and one in the vendor baseline that stays unfixable.