Repository navigation
Make ignore.allLineErrors fixable - #6907
Merged
Merged
Conversation
With reportIgnoresWithoutComments, @phpstan-ignore-line and @phpstan-ignore-next-line are replaced with @PHPStan-Ignore and the identifiers of the errors reported on the ignored line, one for each error. Text after the tag becomes the comment of every identifier. A next-line ignore after code moves to the end of the next line. Amp-Thread-ID: https://ampcode.com/threads/T-01a19bdb-a0f8-76c3-8540-9b8919996af4
The identifiers now include the errors of CollectedDataNode rules reported on the ignored line, which are known only after FileAnalyser. Amp-Thread-ID: https://ampcode.com/threads/T-01a19bdb-a0f8-76c3-8540-9b8919996af4
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.
With
reportIgnoresWithoutComments: true,--fixreplaces@phpstan-ignore-lineand@phpstan-ignore-next-linewith@phpstan-ignoreand the identifiers of the errors reported on the ignored line (one for each error, since each identifier ignores one error).AnalyserResultFinalizer, so the identifiers include errors ofCollectedDataNoderules reported on the ignored line.ignore.noCommentis satisfied. A comment on several PHPDoc lines is joined into one line, because lines after the identifiers would not parse.2, // @phpstan-ignore-next-line) moves to the end of the next line, like in phpstan-fixer.Docs: phpstan/phpstan#15636