Miscellaneous-ImportCSV

Import style violations from CSV file

The rule attaches style violations from a CSV file to corresponding analysed files.
Example
For a CSV file configured using the option filename containing:
"errno";"message";"objectname";"filename";"line";"column";"severity"
"myerr";"violation";"cpp-file";"file.cpp";0;0;"sever"
The following violation for file.cpp will be emitted:
file.cpp:0:0: sever: violation [cpp-file] (Rule myerr)

Possible Messages

This rule has no predefined messages.

Options

column_column

column_column : str | int | None = 'column'

Maps the style violation part 'column' to the column in the CSV file. The values represent the columns in the CSV file. Strings are interpreted as column names as given in the first line of the CSV file. Integers are interpreted as column indices, starting from 0.
 

column_entity

column_entity : str | int = 'objectname'

Maps the style violation part 'entity' to the column in the CSV file. The values represent the columns in the CSV file. Strings are interpreted as column names as given in the first line of the CSV file. Integers are interpreted as column indices, starting from 0.
 

column_error_number

column_error_number : str | int = 'errno'

Maps the style violation part 'error number' to the column in the CSV file. The values represent the columns in the CSV file. Strings are interpreted as column names as given in the first line of the CSV file. Integers are interpreted as column indices, starting from 0.
 

column_line

column_line : str | int | None = 'line'

Maps the style violation part 'line' to the column in the CSV file. The values represent the columns in the CSV file. Strings are interpreted as column names as given in the first line of the CSV file. Integers are interpreted as column indices, starting from 0.
 

column_message

column_message : str | int | None = 'message'

Maps the style violation part 'message' to the column in the CSV file. The values represent the columns in the CSV file. Strings are interpreted as column names as given in the first line of the CSV file. Integers are interpreted as column indices, starting from 0.
 

column_path

column_path : str | int = 'filename'

Maps the style violation part 'path' to the column in the CSV file. The values represent the columns in the CSV file. Strings are interpreted as column names as given in the first line of the CSV file. Integers are interpreted as column indices, starting from 0.
 

column_severity

column_severity : str | int | None = 'severity'

Maps the style violation part 'severity' to the column in the CSV file. The values represent the columns in the CSV file. Strings are interpreted as column names as given in the first line of the CSV file. Integers are interpreted as column indices, starting from 0.
 

delimiter

delimiter : str = ';'

Character used to separate the columns in the csv file. If empty string, a system dependent default (',' or ';') is used.
 

filename

filename : bauhaus.analysis.config.LayerRelativePath = 'None (value must be set)'

Path to the CSV file containing the style violations. Must not be left at its empty default setting.
 

prepend_prefix

prepend_prefix : str = ''

Used to canonicalize the read file path. After stripping the path from the csv file, this prefix is prepended. strip_prefix = '' prepend_prefix = 'components\a' csv path cell says path = 'src\file2.c' the resulting path is 'components/a/src/file2.c'
 

strip_prefix

strip_prefix : str = ''

Used to canonicalize the read file path. This path prefix is removed. It has to end with a separator ('\' or '/'). Stripping is done before prepending. strip_prefix = 'c:\my_project\' prepend_prefix = '' csv path cell says path = 'c:\my_project\components\a\src\file1.c' the resulting path is 'components/a/src/file1.c'