Analysing from the command line

Although the Visual Lint plug-ins for Visual Studio and Eclipse do not have a command line interface, VisualLintConsole (the Visual Lint command line application, available as an optional component in the Visual Lint installer) does.

VisualLintConsole works in exactly the same way as the interactive versions of Visual Lint, but via a command line interface rather than a GUI. It can analyse any project type supported by the Eclipse or Visual Studio plug-ins, as well as projects for environments (e.g. CodeGear C++) for which a dedicated plug-in is not currently available.

For ease of use, the command line interface is based on that of Riverblade's LintProject Professional. It is designed to satisfy two main requirements:

  1. To perform analysis in a build server environment.
     
  2. To update the analysis results on a developer workstation for later use with one of the interactive versions of Visual Lint (VisualLintGui, or the Eclipse or Visual Studio plug-ins).
     

The use of VisualLintConsole on a build server or as a service requires a Build Server licence. In interactive non-build server environments (including scheduled tasks which run only when a user is logged on) it can be used with any valid Visual Lint licence.

 

Configuring VisualLintConsole

For convenience, VisualLintConsole shares its configuration with the interactive versions of Visual Lint, so in many cases you can use them to configure it. When a codebase for a particular development environment (e.g. Eclipse or a specific version of Visual Studio) is loaded, VisualLintConsole will load the analysis configuration for the corresponding environment automatically.

It follows that if you are using VisualLintConsole to update the analysis results for an interactive session no additional configuration is usually necessary.

To configure VisualLintConsole directly, the /showoptions switch can be used to directly access the Options Dialog. If you need to transfer a Visual Lint configuration between user accounts or machines (for example to configure a Visual Lint installation to run under the LocalSystem account on a build server), the /exportoptions and /importoptions switches (see Command line options) can be used to do so.

 

Using VisualLintConsole

For maximum flexibility VisualLintConsole can run both full (like LintProject Professional) and incremental analyses of a codebase. An optional time limit can also be placed on incremental analysis runs; this is specifically designed for use with continuous integration server environments where the run-time of an long analysis run is constrained.

Typical VisualLintConsole command lines* look something like this:

VisualLintConsole solution.sln reportfolder /config="Debug|Win32" /incremental /setmaxtime=15 /exitcode= "warnings > 100 ? 1 : 0" (Visual Studio)

VisualLintConsole c:\users\username\workspace reportfolder /config="Debug" /incremental /setmaxtime=15 /exitcode= "warnings > 100 ? 1 : 0" (Eclipse)

* Although the examples shown are for Visual Studio and Eclipse, those for other project types are very similar.

Once analysis has completed, data on the analysis results detected can be exported from VisualLintConsole if required in a variety of built-in or user defined formats using the /exportfile and /exportformat switches. For full details of the VisualLintConsole command line interface, please see Command line options.



Copyright © 2004 - 2015 by Riverblade Ltd. All rights reserved.