Open boesing opened 2 years ago
Hey @boesing, can you reproduce the issue on https://psalm.dev ?
From what I see, it should be possible.
UnusedPsalmSuppress are handled in there:https://github.com/vimeo/psalm/blob/b4fdc3e326fea865de49827f723a2703bb18617a/src/Psalm/Internal/Codebase/Analyzer.php#L315
The method seem to know the starting position, the end position of the docblock so it should be enough to add a FileReplacement to the buffer
Ninja'd again :laughing:
The method seem to know the starting position, the end position of the docblock so it should be enough to add a FileReplacement to the buffer
/s/FileReplacement/FileManipulation/
But yeah, I don't think it should be too hard, though I haven't done much with the fixer stuff so I wouldn't know too well.
Hm, usually, psalm-suppress
is used like this:
/** @psalm-suppress WhateverIssueToBeSuppressed Lorem ipsum dolor met */
If we now manipulate the file, it might end-up in this:
/** */
Should this be handled by the psalter as well (so that we drop it)?
Yeah, ideally, we should be able to detect the docblock is now empty and remove it. Beware, the docblock could have comments unrelated to the suppression
I was recently wondering why there is no
UnusedPsalmSuppress
issue fixer available.Did anyone ever tried to implement that and stopped working on it due to its complexity? If not, I'd love to work on that. If so, please let me know 👍🏼
Thanks in advance.