Open usinelogicielle opened 2 months ago
I'm trying to find the bug by comparing with the shellcheck plugin code.
I think the problem is here, when I try to get the list of files to process. https://github.com/cnescatlab/sonar-icode-cnes-plugin/blob/8ba25315071e88f5499265f9231abefcd309224a/src/main/java/fr/cnes/sonar/plugins/icode/check/ICodeSensor.java#L181
It only looks at “MAIN” files, but not according to language.
In the shellcheck plugin, an association is made with the file type here: https://github.com/sbaudoin/sonar-shellcheck/blob/463a4421e6ca7f21f594e24f9d6eb639b029a814/src/main/java/com/github/sbaudoin/sonar/plugins/shellcheck/rules/ShellCheckSensor.java#L72
Describe the bug
I have a project with shell and fortran files. If I launch sonar-scanner it fails with this error :
Expected behavior
The shell files are only done with the shellcheck plugin and not Icode.
Complete log
Click me
``` INFO: Scanner configuration file: /work/softs/rh8/projets/ul/sonarscanner/4.8.1/conf/sonar-scanner.properties INFO: Project root configuration file: /Additional context
In the icode plugin :
https://github.com/cnescatlab/sonar-icode-cnes-plugin/blob/8ba25315071e88f5499265f9231abefcd309224a/src/main/java/fr/cnes/sonar/plugins/icode/measures/ICodeMetricsProcessor.java#L87
and here in the shellcheck plugin : https://github.com/sbaudoin/sonar-shellcheck/blob/463a4421e6ca7f21f594e24f9d6eb639b029a814/src/main/java/com/github/sbaudoin/sonar/plugins/shellcheck/measures/LineCounter.java#L82
But this is a consequence and not the cause. My thought is that the plugin tries to find a measure on more than just fortran files. It'would be nice to have a log like the shellcheck plugin to see which file are analyzed :
https://github.com/sbaudoin/sonar-shellcheck/blob/463a4421e6ca7f21f594e24f9d6eb639b029a814/src/main/java/com/github/sbaudoin/sonar/plugins/shellcheck/measures/LineCounter.java#L53C9-L53C15
I found you try to find a solution in the past here : https://github.com/cnescatlab/sonar-icode-cnes-plugin/pull/96/files but it seems it is not really working.