1. Compiling KWStyle

KWStyle is available under BSD-like license and can be downloaded here.
In order to compile KWStyle you need run CMake on the source directory, then compile KWStyle with your favorite compiler. KWStyle is currently tested on Visual Studios and gcc compiler.

2. Running KWStyle

KWStyle is running as a command line executable:

./KWStyle MyFile.cxxx

You can also specify all the command arguments in the KWStyle.xml file (or by using -xml).
In that case you can run KWStyle using:

./KWStyle auto

Different options are available to control the behavior of the testing:

Verbose -v KWStyle -v MyFile.cxx
Specify a configuration file -xml [XMLDescriptionFile.xml] KWStyle -xml MyConfiguration.kws.xml
Overwrite default testing rules -o [Overwrite File.txt] KWStyle -o RulesOverwrite.txt
Write out testing report as HTML files -html [HTMLDirectory] KWStyle -html MyHTMLDirectoryOutput
Do not show tests that are free of errors in the matrix view -lesshtml KWStyle -lessthtml -html MyHTMLDirectoryOutput
Specify a directory instead of a file -d [directory] (accept globbing expressions) KWStyle -d Insight/Code/Common
Combined with -d, recurse the directory -R KWStyle -R -d Insight/Code
Specify a list of files -D [FilenamesFile.txt] KWStyle -D MyFilesToCheck.txt
Specify a blacklist -b KWStyle -b BlackList.txt

3. Integrating KWStyle with CDash (and CTest)

KWStyle can be integrated with CDash as part of the dashboard (see IGSTK or ITK dashboard and look for KWStyle).
In order to generate CDash compatible description you need to set these two options when running KWStyle.

Generate a CDash XML description of the errors -dart [BinaryDirectory] [maximum of errors to report (-1 is all)] [Group the errors per file (1) or per category (0)] -dart ${CTEST_BINARY_DIRECTORY} -1 1
Specify the URL of the generated files -kwsurl [URL of the generated file] KWStyle -kwsurl

CDash can be used easily with CTest to generate the dashboard. Here is an example of a ctest script for KWStyle.
Other scripts can be found in the KWStyle/Web/ctests/ directory.

4. XML Configuration description

It is often easier to run KWStyle with the -xml flag in order to specify a configuration file.
An example of a configuration file is available here: MyConfiguration.kws.xml

The XML tag: <File>MyFile</File> can be specified to run KWStyle on the given file without specifying the current argument.

When generating HTML reports (using the -html option) it is often usefull to add the project information:

<Project>This is my project</Project>

Note that in order to avoid the check of a feature you have to remove the corresponding line in the configuration file.
The complete description of the XML tags can be found here