Current Entries | Archives   RSS

 


Excluding projects and files from analysis

Wednesday 5th December, 2007


One of the additional features available in Visual Lint Professional Edition is the ability to selectively exclude individual projects from automated background analysis. This can of course be useful when (for example) analysing a solution which contains third party code over which you have no control.

In Visual Lint Professional you can exclude a project by clearing the corresponding check box in the Analysis Status Display, or (in VS2002 onwards) by clearing the corresponding command on the Solution Explorer context menu.

At first, we only implemented this facility at project level - although files excluded from build are marked with the analysis status "Excluded" this was not user selectable. That changed in Visual Lint 1.5.5.68 (after a customer request), so you can now specify individual files which should not be analysed. Like the equivalent project level feature, this can be controlled from either the Analysis Status Display or the Solution Explorer.

In implementing this feature we stumbled across a potential pitfall. In whole project analysis the definition of which files should be analysed is contained in a project specific .lnt file. Therefore, the contents of these files need to be modified whenever a file is excluded from or included in background analysis.

The traditional way of doing this - using PC-lint to write the files - simply cannot do this. Fortunately, Visual Lint is perfectly capable of writing these files itself (the option has been there for ages, and since 1.5.4.66 it has been the default), and Visual Lint will now automatically take excluded files into account.

As a result, whole project analysis should automatically ignore excluded files, provided Visual Lint is configured to write the project.lnt files directly, rather than letting PC-lint do it.

Posted by Anna at 8:56pm | Get Permalink