How do you customize SonarLint rules in IntelliJ IDEA?

前端 未结 3 550
悲&欢浪女
悲&欢浪女 2021-02-02 09:03

Is it possible to have SonarLint for IntelliJ IDEA enforce only the rules I have enabled on my Sonar server?

3条回答
  •  感情败类
    2021-02-02 09:44

    As it is now possible with the current release of SonarLint (I'm using version 3.0.0.2041), people might be interested in the solution.

    • File -> Settings -> Other Settings -> SonarLint General Settings
    • Click on the green + in "SonarQube servers" :
      • Enter a name (ex : SonarQube / localhost)
      • Select SonarQube and enter URL like http://localhost:9000
      • Authentication : select your user token or your login/pwd
      • Click on Finish
      • Click on "Update binding" to synchronize with the SonarQube server
    • Go to SonarLint Project Settings and bind your project to the SonarQube project

    Thus, when you open your files, SonarLint will automatically retrieve the SonarQube server's issues.

提交回复
热议问题