Main Content

Select code format tool to use

Formatting tool for generated code

Since R2021a

Description

App Configuration Pane: Code Appearance

Configuration Objects: coder.MexCodeConfig | coder.CodeConfig | coder.EmbeddedCodeConfig

Code formatting options for generated code.

Settings

Use clang format based on heuristics

This setting is the default setting.

Uses an internal heuristic to determine if the generated code is formatted by clang-format or a MathWorks® formatting tool.

If the code configuration property Verbosity is set to 'Verbose', the code generator produces a warning if the heuristic chooses a MathWorks formatting tool.

Always use clang format

The code generator formats the generated code according to a clang-format file.

Always use MathWorks code tool format

Causes the code generator to revert to the MathWorks formatting tool.

Programmatic Use

Property: CodeFormattingTool
Values: 'Auto' | 'Clang-format' | 'MathWorks'
Default: 'Auto'

Version History

Introduced in R2021a