SonarQube SpellCheck Plugin to provide spell checking of source code (for now only Java supported).
- Go to
Rules
and search forSpell Check
rule - Click on found
Spell Check Rule
and then onActivate
- In appeared dialog box select required profile to activate rule for and click
Activate
Spell Check Rule
will be activated in selected profile, in our caseSonar Way
profile
You can add custom dictionary in SpellCheck Plugin Settings
:
- Go to
Settings->General Settings->SpellCheck
. - Add word to textarea
Alternative dictionary
(separated with comma) - Click
Save SpellCheck Settings
- Go to your projects
Issues
tab - Find SpellCheck
Issue
of the word that is unknown by plugin, however is OK for your project, click onMore
->Add to Dictionary
- Word will be added to your
Alternative dictionary
- Download SonarQube (current version 5.1) from SonarQube homepage
- Unpack and go to sonarqube-5.1/conf folder
- Enable the development mode on server : add
bash sonar.dev=true
to sonar.properties . For Windows machines usesonar.dev=true
. - Go to folder sonarqube-5.1/bin. Select you current OS and run SonarQube (can be ".bat" or ".sh" file)
- In browser go to - http://localhost:9000/
- Login in SonarQube as Administrator (login - admin, password - admin)
- On SonarQube page top menu go to the "Quality Profiles". You need to make sure that "Sonar way " stands as the default
- Make some code changes
- Build and install the plugin :
bash mvn package org.codehaus.sonar:sonar-dev-maven-plugin::upload -DsonarHome={sonarqube-5.1} -DsonarUrl=http://localhost:9000
. Use correct location of Sonarqube for the parameter -DsonarHome, for example-DsonarHome=d:\Sonar5.1
- Restart SonarQube
- Activate SpellCheck rule for your
Quality Profile
- To perform spell check analysis go to the project that you want to test and write
bash mvn sonar:sonar
command (for Windows machines usemvn sonar:sonar
), for debug usebash mvnDebug sonar:sonar
command (by default debug port is 8000) - After that you can see results on http://localhost:9000/dashboard/ or follow the link that will be found in the bottom of command line output
- To analyse using Docker based installation execute
mvn sonar:sonar -Dsonar.host.url=http://192.168.176.128:9000/ -Dsonar.jdbc.url=jdbc:mysql://192.168.176.128:3306/sonarqube -Dsonar.jdbc.username=sonarqube -Dsonar.jdbc.password=sonarqube
There is built in dictionary, however to add additional words here is a bash script to rearrange dictionary. To do this - append new word to src/main/resources/dict/english.0, run reprocess_dict.sh after that copy src/main/resources/dict/english.1 with new word and in correct format to src/main/resources/dict/english.0.