Check options

See also

Please make sure to read PIO Check guide first.

check_tool

Type: String | Multiple: Yes | Default: cppcheck

A name of the check tool used for analysis. This option is useful when you want to check source code with two or more tools.

See available tools in Check tools.

Example

[env:myenv]
platform = ...
board = ...
check_tool = cppcheck, clangtidy

check_filter

Type: String (Pattern) | Multiple: Yes

This option allows specifying which source files should be included/excluded from the check process. The filter supports 2 templates:

  • +<PATH> include template
  • -<PATH> exclude template

PATH MUST BE related from a project root directory. All patterns will be applied in their order. GLOB Patterns are allowed.

Another option for filtering source files is platformio check --filter command.

Example

[env:custom_check_filter]
platform = ...
board = ...
check_tool = clangtidy
check_filter = -<*> +<src/module_to_check>

check_flags

Type: String | Multiple: No

Additional flags to be passed to the tool command line. This option is useful when you want to adjust the check process to fit your project requirements. By default, the flags are passed to all tools specified in check_tool section. To set individual flags, define tool name at the beginning of the line.

Another option for adding flags is platformio check --flags command.

Example

[env:extra_check_flags]
platform = ...
board = ...
check_tool = cppcheck, clangtidy
check_flags =
  --common-flag
  cppcheck: --enable=performance --inline-suppr
  clangtidy: -fix-errors -format-style=mozilla

check_severity

Type: String | Multiple: Yes | Default: low, medium, high

This option allows specifying the Defect severity types which will be reported by the Check tools.

Another option for filtering source files is platformio check --severity command.

Example

[env:detect_only_medium_or_high_defects]
platform = ...
board = ...
check_severity = medium, high