Skip to content

SonarQube SpellCheck Plugin to provide spell checking of source code

Notifications You must be signed in to change notification settings

webdizz/sonarqube-spellcheck

Repository files navigation

sonarqube-spellcheck

SonarQube SpellCheck Plugin to provide spell checking of source code (for now only Java supported).

Status

Build Status Bitdeli Badge

Usage

Activate SpellCheck rule for your Quality Profiles

  1. Go to Rules and search for Spell Check rule Find SpellCheck Rule
  2. Click on found Spell Check Rule and then on Activate Select SpellCheck Rule
  3. In appeared dialog box select required profile to activate rule for and click Activate Activate SpellCheck Rule
  4. Spell Check Rule will be activated in selected profile, in our case Sonar Way profile Activated SpellCheck Rule in Sonar Way profile

Add word/amend dictionary with custom words:

You can add custom dictionary in SpellCheck Plugin Settings:

  1. Go to Settings->General Settings->SpellCheck. SpellCheck settings
  2. Add word to textarea Alternative dictionary (separated with comma) SpellCheck settings
  3. Click Save SpellCheck Settings

Add word/amend dictionary from Issue:

  1. Go to your projects Issues tab Issues tab
  2. Find SpellCheck Issue of the word that is unknown by plugin, however is OK for your project, click on More->Add to Dictionary
  3. Word will be added to your Alternative dictionary Issues tab

Development

Environment requirements:

  1. Java 1.7
  2. Maven
  3. SonarQube (current version 5.1)

Development Set Up:

  1. Download SonarQube (current version 5.1) from SonarQube homepage
  2. Unpack and go to sonarqube-5.1/conf folder
  3. Enable the development mode on server : add bash sonar.dev=true to sonar.properties . For Windows machines use sonar.dev=true.
  4. Go to folder sonarqube-5.1/bin. Select you current OS and run SonarQube (can be ".bat" or ".sh" file)
  5. In browser go to - http://localhost:9000/
  6. Login in SonarQube as Administrator (login - admin, password - admin)
  7. On SonarQube page top menu go to the "Quality Profiles". You need to make sure that "Sonar way " stands as the default

Development and run:

  1. Make some code changes
  2. 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
  3. Restart SonarQube
  4. Activate SpellCheck rule for your Quality Profile
  5. To perform spell check analysis go to the project that you want to test and write bash mvn sonar:sonar command (for Windows machines use mvn sonar:sonar), for debug use bash mvnDebug sonar:sonar command (by default debug port is 8000)
  6. 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
  7. 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

Amend default dictionary:

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.

About

SonarQube SpellCheck Plugin to provide spell checking of source code

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages