Skip to content

Make unmatched ignoreErrors entries without a path fixable - #6923

Merged
ondrejmirtes merged 1 commit into
2.3.xfrom
fixable-unmatched-ignores-without-path
Nov 3, 2026
Merged

ondrejmirtes merged 1 commit into
2.3.xfrom
fixable-unmatched-ignores-without-path

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

An unmatched ignoreErrors entry without a path, like

-
	rawMessage: 'haha what a story Mark'

was reported as a message that is not specific to any file (Ignored error "..." was not matched in reported errors.), so --fix could not remove it, unlike path-specific unmatched entries.

It is now reported as ignore.unmatched in the config file, on the line of the entry, and --fix removes it. This covers entries without a path in PHP and NEON config files, plain string patterns (- '#pattern#'), and entries with an fnmatch path. 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.

Tested by IgnoreErrorsConfigFixerTest and by the e2e/fix-baseline scenario, which now has two entries without a path in the NEON baseline and one in the vendor baseline that stays unfixable.

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
@ondrejmirtes
ondrejmirtes merged commit a99d1d2 into 2.3.x Nov 3, 2026
704 of 705 checks passed
@ondrejmirtes
ondrejmirtes deleted the fixable-unmatched-ignores-without-path branch November 3, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant