vscode代码库登录配置_VSCode 配置 Sonar Lint支持代码检查提效
生活随笔
收集整理的這篇文章主要介紹了
vscode代码库登录配置_VSCode 配置 Sonar Lint支持代码检查提效
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
安裝SonarQube插件
在VScode的擴(kuò)展里面,安裝SonarQube support for Visual Studio Code extension, 在安裝了 SonarQube 之后,使用打開 VSCode 命令搜索功能,輸入 Sonar,搜索結(jié)果如下:
sonar lint 全局配置文件
(1)選擇 Create global config with credentials to servers
(2)選擇Open global.json,sonar lint 全局配置文件被打開,
{ "$schema": "https://raw.githubusercontent.com/silverbulleters/sonarqube-inject-vsc/master/schemas/global.json", "servers": [ { "id": "localhost", "url": "http://localhost:9000", "token": "YOUR_SONARQUBE_AUTH_TOKEN" }, { "id": "my-company-server", "url": "http://my-company.com", "token": "YOUR_SONARQUBE_AUTH_TOKEN" } ] }(3)接下來只需要自定義上圖對(duì)應(yīng)字段(上圖兩個(gè)配置項(xiàng)只需定義一個(gè)即可)
- id:與具體工程關(guān)聯(lián)的唯一標(biāo)識(shí)符,在具體工程配置文件中會(huì)用到
- url:sonar server 所在的地址
- token:能進(jìn)入 sonar server 的用于驗(yàn)證用戶身份的一串字符
sonar lint 工程配置文件
(1)選擇 Create local sonarlinet config with project binding
(2)選擇 Open sonarlint.json,sonar lint 工程配置文件被打開,
{ "serverId": "my-company-server", "projectKey": "my-project"}(3)接下來自定義上圖對(duì)應(yīng)字段,
- serverId:即配置全局文件時(shí)的 id
- projectKey:sonar server 上的工程唯一標(biāo)識(shí)
其他命令
- Analyze current file:重新分析當(dāng)前文件
- Analyze current project:重新分析當(dāng)前工程所有文件
- Update bindings to SonarQube server:更新來自 Sonar Server 的規(guī)則
總結(jié)
以上是生活随笔為你收集整理的vscode代码库登录配置_VSCode 配置 Sonar Lint支持代码检查提效的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sap生产工单报工_SAP系统PP (
- 下一篇: aspen求理论塔板数_aspen 塔设