checkEditorWarnings

Checks if any warning messages are shown to the user in the MATLAB editor. With this check, the user does not need to open a file to see the editor warnings. Warning messages that are suppressed in the MATLAB editor are ignored by this check.

Configurable parameters

  • MlintSettings (string): Choose what settings to use when checking for editor warnings. Options are:

    • Local (default): Use the currently active local settings. This means that the editor warnings as shown in the MATLAB editor will be reported. For more information on changing these settings locally, see this page.

    • Coder-compatibility: Use settings related to coder-compatibility when checking for editor warnings.

    • Factory: Use the factory default settings when checking for editor warnings as shipped with MATLAB.

    • FromFile: Apply changes to the factory settings as defined in a txt-file whose location is given with the SettingsLocation parameter of this check. For more information on creating such a file, see this documentation.

  • SettingsLocation (string): This parameter is only used if the MlintSettings parameter is set to FromFile. It specifies where the settings file that must be used for checking for editor warnings, is located. The file must have extension .txt. It can be an absolute path. If it is not an absolute path, the file is expected to be on the MATLAB path. Keep possible namespaces in mind. The file must be findable using MATLAB-installed function which. If the file is not found this way, it is searched for in the currently active configuration folder (which does not have to be on the MATLAB path). For more information on the manipulation of the configuration folder, see .

  • MessageIDs(list): Define a list of message IDs to warn for, an empty list or 'all' reports all warning messages found. For example, the message ID 'AGROW' reports violations related to: The variable <name> appears to change size on everly loop iteration. Consider preallocating for speed.

See Check Code for Errors and Warnings Using the Code Analyzer for more information about checking MATLAB code for errors and warnings.

Note that this check can be configured multiple times, but the warning messages are obtained once. Which means that only one combination of the parameters 'MlintSettings' and 'SettingsLocation' can be used. Therefore it is necessary to configure those two parameter identical for all configuration of this check. If this is not the case when editing a configuration in the Configuration Editor, a dialog will pop up and you will get notified about non-identical parameter values.

Exemption tag: %@ok<EDWRN>