Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- how is SonarQube deployed: zip, Docker, Helm
- what are you trying to achieve
- what have you tried so far to achieve this
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
9.9 LTS: I am trying to add rubocop issues to SonarQube.
I have added the
properties["sonar.ruby.rubocop.reportPaths"] = file(project.rootDir).resolve("rubocop-report.json")
line, and during pushing those files, the report file exists - also the sources:
e[32;1m$ ls -lahe[0;m
total 732K
drwxrwxrwx 18 root root 4.0K Jun 28 16:28 .
drwxrwxrwx 4 root root 4.0K Jun 28 16:26 ..
-rw-rw-rw- 1 root root 4 Jun 28 16:27 .dockerignore
drwxrwxrwx 7 root root 4.0K Jun 28 16:27 .git
...
drwxrwxrwx 27 root root 4.0K Jun 28 16:28 backend
...
-rw-r--r-- 1 root root 350K Jun 28 16:06 rubocop-report.json
(I hope I don’t need to do ls -lahR
to prove my point).
I have checked the rubocop-report.json
, and the files are reported relative to the above pwd
; also the sonar
task is running at the same pwd
.
{"metadata":{"rubocop_version":"1.64.1","ruby_engine":"jruby","ruby_version":"3.1.4","ruby_patchlevel":"0","ruby_platform":"java"},"files":[{"path":"backend/.irbrc","offenses":[{"severity":"warning","message":...
However, still I get:
Fail to resolve 159 file(s). No RuboCop issues will be imported on the following file(s): backend/.irbrc;.....
What am I missing here?
Could it be that ./gradlew sonar -Dsonar.exclusions="backend/**/*"
is affecting that resolution?
If not, what is it?
I assume that the “juice” is slang/sonar-ruby-plugin/src/main/java/org/sonarsource/ruby/externalreport/rubocop/RuboCopSensor.java at b3bb437b7c8d713e82fe23c26d99c0af8519fc48 · SonarSource/slang · GitHub, but debugging CI (and a foreign program) is always hard.