Welcome! Kotlin Beginners. Our team decide to set up new development environment for changing development stack Ruby on Rails to Kotlin&Spring Boot. Most of our engineers only have experience using Java/Rails.
So, We need engineering process for writing “GOOD” kotlin code. There’s so many software engineering practice for maintaning quality of software. However, Our team is in startup phase. So, we decided start with small but essential code review process. Before request review, All developer should do self-checking with static anaylsis tool. It can be helpful for reducing time-consuming review. In this tutorial, i will let you know how to setup static analysis tool for kotlin development environment step by step.
Prerequisites
- Docker desktop (https://www.docker.com/products/docker-desktop)
- IntelliJ (https://www.jetbrains.com)
You can also install SonarQube server on your own local environment. In that case SonarQube need Java 11 for running. Try to avoid dependency hell, Running dependencies on docker is smart choice.
1. Get SonarQube docker image
docker pull sonarqube
2. Run SonarQube container
docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube
It take some time SonarQube loaded fully. After SonarQube is loaded completely, You can see SonarQube dashboard on http://localhost:9000
3. Install SonarLint(IntelliJ plugin) for integrating with SonarQube
4. Bind to local sonarqube
Set configuration name you wanted and sonarqube url to http://localhost:9000
5. Analyzed code in SonarLint tab
As our product migrating to Kotlin&Spring Cloud, I will blogging how we did it, how to solve problem when happened migrating to new environment. Stay tuned!