-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Replace TextFile::pathId #4425
Conversation
661afeb
to
7cf4d44
Compare
Note that this actually reverts #4464, or rather fixes the problem in another way. I think the better parameter order is file name then source contents, as it was already in PMD 7 until #4464. However the file name parameter doesn't have type string anymore but FileId, so that removes the possible confusion. |
… pmd7-textfile-display-name
1583d14
to
6cb92a8
Compare
Generated by 🚫 Danger |
in RuleViolation.getFilename() -> RuleViolation.getFileId()->getFileName() Refs pmd/pmd#4425
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I'll merge this now, as this affects many downstream libs/clients (maven-pmd-plugin, eclipse, potentially github-actions with sarif), so that we get out this breaking change early.
[core] Replace TextFile::pathId #4425
Describe the PR
Replace the pathId and display name of TextFile with a FileId instance. This eliminates the confusion between both, because both were strings. It also allows renderers to pick more freely how to display the file name. For instance the Sarif renderer always requires URIs, however neither pathId or display name specify that they should be URIs. By default they use a FileNameRenderer (function FileId->String) which does the same relativization as we did before in the file collector. This also replaces
RuleViolation::getFileName
withRuleViolation::getFileId
so that the id is given to renderers, and we don't hardcode a display method in the RuleViolation.Related issues
Ready?
./mvnw clean verify
passes (checked automatically by github actions)