How to: Select a Specific Ruleset for Analysis

As standard SPCAF comes preset with 6 pre-configured rulesets which you can use to analyze your project. It is possible to even use your own custom Ruleset. These rulesets are as follows:

  • All Analyzers
  • Minimum Settings
  • Minimum Recommended Settings
  • Extended Recommended Settings (default)
  • SharePoint Framework - All Rules
  • Angular Application

For more details of these rules please click here.

Depending on the interface that you use SPCAF to analyze your project, please follow the instructions below:

Client Application

In order to select the ruleset for analysis in the Client Application you will need to:

  1. Open the client and choose either a file or folder to analyze.SPCAF-RuleSelection-Add_1124x800.png
  2. On the "Configure Analysis" screen click below settings.
  3. Depending on whether you wish to use a default ruleset or a custom ruleset you will need to follow the details below.
    1. Default ruleset

      A drop-down menu will appear, from here select the ruleset, you wish to use for analysis. SPCAF-RuleSelection-Select_1124x800.png
    2. Custom Ruleset

      Alternatively, if you wish to use a custom ruleset, on the same screen click the "Folder" icon to open a custom ruleset.SPCAF-RuleSelection-Select_1124x800.png
  4. Then click "Save" and run the analysis as normal.

Visual Studios

In order to select the ruleset for analysis in the Visual Studio you will need to:

  1. Click on "Tools"
  2. Go to "SharePoint Code Analysis"
  3. Then click on "Ruleset:<name of a ruleset>".
  4. A pop up will appear with a drop-down menu, from here select the ruleset, you wish to use for analysis.
    SPCAF-RuleSelection-VSSelect_84x316.png
    • If you wish to use a custom ruleset, select <browse> a file dialog will appear, select the ruleset you wish to use.
  5. Then click "OK" and run the analysis as normal.

PowerShell

In order to select the ruleset for analysis in the PowerShell, you will need to make sure that the parameter "SettingsFile" is set, to the filename and location of the ruleset you wish to use.

CmdLine

In order to select the ruleset for analysis in the CmdLine, you will need to set the filename and path for the argument -s (for example the command line would be spcaf.exe -s "C:\Program Files (x86)\Rencore\SPCAF\Rulesets\RS00_AllRules.spruleset).

TFS2015

The recommended practice is to configure and store a settings file per project. This allows you to change the build requirements for that project without affecting other projects.

In order to select the ruleset for analysis in TFS2015, you can either type the file location in the field for "Settings File" or click the ellipses next to the next to the field and select the file directly.SPCAF-RuleSelection-TFSSettingsFile_1589x521.png

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.