Check options

See also

Please make sure to read Static Code Analysis 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_patterns

Type: String (Pattern) | Multiple: Yes

This option allows specifying which source files or folders should be included/excluded from the check process. GLOB Patterns are allowed. src_dir and include_dir folders are checked by default.

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

Example

[env:custom_check_patterns]
platform = ...
board = ...
check_tool = clangtidy
check_patterns =
  app/sources
  tests/hardware/*.c

check_flags

Type: String | Multiple: Yes

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