Hello,
I'm writing a custom Check which is more of a sort of reporting tool than a real Check; it will create a list of all slf4j logger message used in a class, for external publication, but never call AbstractCheck's log.
In that check, I want to get the name of the file being analysed, in order to say write that into a text file. I've found getFileContents().getFileName(), but that gives the absolute path, which is not ideal.
Is there some handstand with Checkstyle's existing API that I could use to obtain the file under check's path relative to the project? After all, the Checkstyle report also shows relative paths. I can make them relative within my custom Check, with some heuristic to find the base path (e.g. where there is a pom.xml ..), but that seems brittle, and I'm hoping there is a better way.
If this is impossible as-is, then would an enhancement suggestion to have a getRelativeFileName() on FileContents be sensible?
Thank you,
Michael