注:此插件为GitLabProjects与Sonarlint的整合,需先卸载这两个插件。 当提交MR时会进行Sonar扫描,有Bloker和Critical级别的issue时将无法MR。
- 在此处下载插件: GitLab-SonarLint.zip
- 配置Gitlab与Sonarlint,如: http://git.scm.ppmoney.com/
image.png
Token在此获取: http://git.scm.ppmoney.com/profile/personal_access_tokens
image.png
image.png
- 提交代码时确保勾选 Perform SonarLint analysis
image.png
这里可以会忽略没有去修改sonar问题,但当 Create Merge Request时将再次进行Sonar扫描。如果存在Bloker或Critical的issues时将无法创建MR
image.png
通过插件提交MR
注意只有通过IDEA插件提交MR才会检测到,网页版会绕过sonarLint的检测
image.png
如果出现提交远程提交错误,
image.png
请到项目根目录.git,修改config文件,删除圈起内容。
image.png