I’m trying to add support for incremental PR analysis in a language plugin. It looks like it was implemented in the Kotlin plugin in this commit
It is using SensorContext#canSkipUnchangedFiles, whose Javadoc says:
In some situations, there is no need to analyze unchanged files, as reported by
InputFile.Status.SAME, and analyzers can skip reporting any data for those files. Plugins should be prepared for the flag to be always false in the future.
The first part of the doc makes me think that if this flag is true, and
SAME, then I can skip the analysis of this file. But what does the second part means ? Is that deprecated ?
I’ve changed a couple lines in the main sensor of my plugin to display the file status, and canSkipUnchangedFiles. The file status seems to match the files modified in the Git branch. Would that work with a different SCM ? Or does that rely on the Git plugin to flag some files to be unchanged ?
It also says that the method was introduced in 9.4. In a more general way, what is the minimum SonarQube version that is required ? And any requirement on sonar-scanner version ?