Main Content

polyspace-catalog-bundler

(DOS/UNIX) Create user-defined Polyspace coding standards at the DOS or UNIX command line

Since R2024b

Description

Note

This Polyspace® command is available in polyspaceroot\polyspace\bin. Here, polyspaceroot is the Polyspace installation folder, for example, C:\Program Files\Polyspace\R2024b. (See also Installation Folder for desktop products or Installation Folder for server products). To avoid typing the full path to this command, add this location to the PATH environment variable in your operating system.

polyspace-catalog-bundler import -catalog Definition -bundle UserDefinedCodingStandard creates the user-defined coding standard (.pschk) UserDefinedCodingStandard using the definition specified in the file Definition. A user-defined coding standard is a collection of coding rules that Polyspace can check by using existing Polyspace Bug Finder™ defect and coding rule checkers. In the file Definition, you specify how the coding rules in the custom standard relate to the existing Polyspace checkers. After running the command, you can use the user-defined coding standard file (.pschk) as an input to the option Checkers activation file (-checkers-activation-file) to check for violations of the coding rules in the user-defined coding standard. When running a Polyspace Bug Finder analysis using the standard UserDefinedCodingStandard, Polyspace calculates a unique checksum using the SARIF file in Definition and shows the checksum in the analysis log. This checksum indicates whether the SARIF file in Definition changed since your last analysis.

example

polyspace-catalog-bundler import -catalog Definition -bundle UserDefinedCodingStandard -identifier standardID creates the user-defined coding standard UserDefinedCodingStandard and associates an identifier standardID to the standard. When you run a Polyspace Bug Finder analysis using the standard UserDefinedCodingStandard, Polyspace shows the identifier standardID in the analysis log in addition to the checksum of the SARIF file in Definition.

Examples

collapse all

Create a user-defined coding standard consisting of existing Polyspace Bug Finder checkers.

Before you create a user-defined coding standard, select a set of coding rules against which you want to check your code. Once you select a set of coding rules, find appropriate Bug Finder checkers that can be used to check for violations of the rules. See Find Polyspace Bug Finder Checkers That Map to Coding Rules in User-Defined Coding Standard.

Encode the relationship between the user-defined coding standard and existing checkers in a SARIF file mySarif.SARIF. See Create User-Defined Coding Standard by Using Polyspace Bug Finder Checkers.

To create the user-defined coding standard myCppStandard.pschk, at the command line, enter:

polyspace-catalog-bundler import -catalog mySarif.SARIF -bundle myCppStandard.pschk -identifier StandardVerA
The coding standard myCppStandard.pschk is saved in the current folder.

Input Arguments

collapse all

Path to the file containing the definition of the user-defined standard. Polyspace supports the SARIF format for the definition file.

The definition file describes how the coding rules are organized and which Bug Finder checks correspond to which coding rule in the standard. For more information, see Create User-Defined Coding Standard by Using Polyspace Bug Finder Checkers.

Example: myMapping.SARIF

Path to the user-defined coding standard file (.pschk) that is created after running this command. Use this file as an input to the Checkers activation file (-checkers-activation-file). You can also use this file by opening it from the Checkers Selection window.

Example: myStandard.pschk

An identifier string for the user-defined coding standard. The identifier is printed in the analysis log when you run a Polyspace Bug Finder analysis using a user-defined coding standard. The identifier can help you keep track of the user-defined standard that you use for your analyses.

Example: myStandard.pschk

Version History

Introduced in R2024b