Hello,
I want to migrate from SQ 7.9.3 to SQ 8.9.2.
In my project, developers are using pylint, with a specific pylintrc file.
The previous pylint repository does no longer exist in SQ 8.9, so :
How to take in account the error/warning messages from pylint ?
example: the rule Access of nonexistent member (rule “Pylint:E1101” in pylint repo in SQ 7.9) seems no exist in the repositories of SQ 8.9 (SonarQube and Common Python)
What the best procedure for “using” the previous Python Quality profile used in SQ 7.9 ?
(in addition with Importing Third-Party Issues
Indeed – in SonarQube v8.9 LTS it is no longer possible to manage Pylint rule sets in SonarQube (checkout MMF-1778 for some more background).
Issues will need to be imported by Importing Third-Party Issues as you’ve already noted. In what is maybe good news – everything configured via a pylintrc file will just work when importing pylint issues as third-party issues (what rules are disabled, files are ignored, etc.)
Thank you for the answer.
Do I have to change the text output of pylint in to the json expected format ?
Is there somewhere a tool that automate the task ?
Sorry If I did get the context (I’am not an expert on SonarQube)
eg
pylint output: src/sample/my_method.py:9: [W0612(unused-variable), func_1] Unused variable 'a' →
Thank you for the answer.
I understand that the pylint option –output-format=parseable avoid the low-level option –msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"
…but the output text file still lines as src/sample/my_method.py:9: [W0612(unused-variable), func_1] Unused variable 'a'…
without indication for SonarQube to know what is the severity of the violated rule (here unused-variable).
I tried to modify manually the xml quality profile file (eg MAJOR → MINOR severity) but I dif not see any change…
Thank you for the confirmation. It’s true I read this statement but I believed it was possible to set-up a workaround.
Developers in my project won’t be happy the see their Quality Gates failed (threshold on the major issues…).
Have a good day !
I just stumbled across this as well. Having all Pylint issues set to Major is a show stopper for us, since we had most of them on Minor. I think I will have to stop linting with Pylint, since not upgrading SonarQube is not really an option. It’s a real shame the default external issue priority is not configurable.
I found a workaround: import the Pylint report as generic issues. With a little bit of magic from jq it’s possible to transform Pylints default JSON output to the format SonarQube expects:
Hello,
(sorry for the delay) I 've tried the solution above and it works !
Thank you very much.
Now, about the severities, it’s not obvious to let SonarQube working like the previous configuration (Sonar 7.9). In my understanding it is not possible to link an external issues to a rule (with its severity) with an existing Quality Profile.
So an intermediate step has to be set-up somewhere.
I’ve written a PyLint plugin that exports to a JSON format SonarQube can import, and for which you can easily configure the severity and effort per rule: