Skip to content

Configuration ​

malt is configured via a .malt.toml file in your project directory. This page is the complete reference for the configuration schema.

Config File Discovery ​

malt looks for .malt.toml in the current working directory by default. You can override this with the --config flag:

bash
malt --config path/to/config.toml src/**/*.m

If no config file is found and --config is not specified, malt uses the built-in mathworks preset (see Presets).

Presets ​

Presets are named, curated sets of default category overrides. Pick one with [lint] preset, or the --preset CLI flag, which takes priority over the config file.

PresetDisabled categoriesDescription
mathworks (default)custom-checks, namingMatches MATLAB Code Analyzer's factory configuration: complexity metrics and naming conventions are opt-in.
all—Every rule enabled, including the default-off engines.
recommendedperformance, readability, formatting, suggested-improvements, naming, custom-checksErrors and warnings on; Info-level style/suggestion checks off.
toml
[lint]
preset = "recommended"
bash
malt --preset all src/**/*.m

A preset only removes categories; the specialized engines that are off by default stay off under mathworks and recommended. all is the exception and turns them on as well.

Precedence: --preset > [lint] preset > mathworks. Explicit [lint.categories] / [lint.rules] entries always win over the preset, so a preset-disabled category can be re-enabled:

toml
[lint]
preset = "recommended"

[lint.categories]
readability = "info"   # re-enable the readability suggestions

Presets are defined in crates/malt_core/src/preset.rs; adding one is a single row in the PRESETS table.

Schema Overview ​

.malt.toml
toml
[lint]
# Global lint settings
exclude = ["vendor/**", "third_party/**"]
preset = "recommended"          # Preset: all | mathworks | recommended

[lint.categories]
# Per-category severity overrides
performance = "off"            # Disable every performance rule
compatibility = "warn"         # All compatibility checks warn

[lint.rules]
# Per-rule configuration (shorthand or full table)
NOSEMI = "warn"                # Shorthand: just set severity
AGROW = "off"                  # Disable a rule
COMPAT = "error"               # Escalate to error

[lint.rules.NOSEMI]            # Full table: severity + rule parameters
severity = "error"
ignore_functions = ["disp", "fprintf"]

[lint] Section ​

exclude ​

A list of glob patterns for files and directories to skip when linting.

toml
[lint]
exclude = [
    "vendor/**",
    "third_party/**",
    "test/fixtures/**",
]

Type: Array of strings (glob patterns) Default: [] (no exclusions)

preset ​

The named preset to base the configuration on. See Presets.

toml
[lint]
preset = "recommended"

Type: string ("all", "mathworks", or "recommended") Default: "mathworks"

[lint.categories] Section ​

Set the severity for every rule in a category at once. Keys are category slugs; values are severity strings. This is resolved below per-rule config: a rule-level override always wins over its category-level setting.

toml
[lint.categories]
performance = "off"            # Disable all performance rules
compatibility = "warn"         # All compatibility rules warn
formatting = "info"            # All formatting rules are informational

Available categories:

CategoryConfig KeyIncludes
Incomplete Analysisincomplete-analysisQUIT, NOFIL, RDERR, MBIG, MDEEP …
Syntax Errorssyntax-errorsBADCT, RESWD, DOUQT, NOPAR2, SYNEND …
Language Specificationlanguage-specificationPF*, FV*, MC*, AT* checks
BugsbugsIFBDUP, CTRUE, LOGEMP, INCR, DECR …
Custom Checkscustom-checksCyclomatic complexity, nesting, line metrics
Namingnamingnaming.* checks (81)
CompatibilitycompatibilityDeprecated/removed function checks
Forward Compatibilityforward-compatibilityFCLEN, FCCPV, FCDQS, FCFAV …
Good Practicesgood-practiceseval, error handling, OOP practices
Unset Variablesunset-variablesNODEF, PSET, USENS …
Unused Constructionsunused-constructionsNOEFF, NUSED, EQEFF, UNRCH …
Suggested Improvementssuggested-improvementsFunction replacement suggestions
ReadabilityreadabilityISCHR, IJCL, NBRAK2, STREMP …
FormattingformattingNOSEMI, NOCOMMA, ALIGN, NOPRT …
PerformanceperformanceAGROW, PFBNS, AND2, MINV …
Code Generationcode-generationMATLAB Coder constraints
Fixed-Pointfixed-pointFPASE
DeploymentdeploymentMATLAB Compiler constraints
System Objectssystem-objectsSONUMIN, SOTUNPROP* …
UnsupportedunsupportedMCADE, AWTIUD, FEATUD …
Behavior Changesbehavior-changesVersion behavior-change checks
Configuration Issuesconfiguration-issuesBDCFG, CFERR, BDOPT, CFIG

[lint.rules] Section ​

Configure individual rules. Each key is a rule ID. Values can be either a severity shorthand (string) or a full configuration table.

Most rule engines are registered under their engine ID (e.g. GOOD_PRACTICES_ENGINE, LANGUAGE_SPEC_ENGINE, COMPAT), and each engine exposes its individual check IDs through its parameters. See Per-Engine Parameters below.

Severity Shorthand ​

Set a rule's severity with a single string value:

toml
[lint.rules]
NOSEMI = "warn"       # Override severity to warning
AGROW = "error"       # Override severity to error
COMPAT = "info"       # Override severity to info
CUSTOM_CHECKS = "off" # Disable the rule entirely

Valid Severity Values ​

ValueAliasesEffect
"error""err"Rule violations are errors
"warn""warning"Rule violations are warnings
"info""note"Rule violations are informational
"off""false", "disabled"Rule is completely disabled

Full Table Configuration ​

For rules that accept parameters, use a full TOML table:

toml
[lint.rules.NOSEMI]
severity = "error"
ignore_functions = ["disp", "fprintf", "warning", "error"]

Or equivalently as an inline table:

toml
[lint.rules]
NOSEMI = { severity = "error", ignore_functions = ["disp", "fprintf"] }

The severity key is always optional in a full table. If omitted, the rule uses its default severity.

All other keys in the table are rule-specific parameters (see Per-Engine Parameters).

Default Behavior ​

When no .malt.toml is present:

  • The mathworks preset is active, so custom-checks and naming are off
  • These specialized engines are off by default under every preset except all (opt in per rule or per category):
    • CODEGEN_ENGINE (code-generation) — MATLAB Coder constraints
    • DEPLOYMENT_ENGINE (deployment) — MATLAB Compiler constraints
    • SYSTEM_OBJECTS_ENGINE (system-objects) — matlab.System validation
    • CONFIG_ISSUES_ENGINE (configuration-issues) — config-function misuse
    • SUGGESTED_IMPROVEMENTS (suggested-improvements) — replacement hints
    • UNSUPPORTED_ENGINE (unsupported) — platform-specific features
  • All other rules are enabled at their default severity
  • No files are excluded
  • No rule-specific parameters are set

Each rule page shows whether the rule is enabled by default. To opt in:

.malt.toml
toml
[lint.categories]
code-generation = "error"   # enable the whole category

[lint.rules]
NAMING_ENGINE = "info"      # or enable a single rule

Severity Override Precedence ​

The effective severity for each rule is resolved as:

  1. Per-rule override (if [lint.rules.XXXX] specifies severity or uses the shorthand)
  2. Per-category override (if [lint.categories.XXXX] is set for the rule's category)
  3. Rule's built-in default (if neither override is present)

The config override applies to all diagnostics produced by that rule — rules themselves always emit their default severity, and the engine stamps the override afterward.

Per-Engine Parameters ​

Multi-check engines take their parameters through their engine ID. Every engine also accepts disabled_checks (or skip_checks) to turn off specific check IDs.

toml
[lint.rules.LANGUAGE_SPEC_ENGINE]
disabled_checks = ["PFEVC", "PFANSLP"]   # Turn off specific checks
Engine IDCategoryParameters
INCOMPLETE_ANALYSISincomplete-analysismax_diagnostics, max_parse_errors, max_node_count (linter-internal limits)
SYNTAX_ERRORS_ENGINEsyntax-errorsdisabled_checks
LANGUAGE_SPEC_ENGINElanguage-specificationdisabled_checks
BUGS_ENGINEbugsdebug_functions, higher_order_functions (extra function names to treat as debug/higher-order)
CUSTOM_CHECKScustom-checksmax_function_inputs, max_function_outputs, max_function_lines, max_line_length, max_nesting_depth, max_cyclomatic_complexity, max_strict_cyclomatic_complexity, max_avg_cyclomatic_complexity, max_branches, max_return_points, max_nested_functions, max_anonymous_functions, max_local_variables, max_local_constants, max_called_functions, max_semicolons_per_line, max_tree_children, max_persistent_variables, max_conditions, max_input_args_used, max_output_args_used
NAMING_ENGINEnamingmax, min, pattern, prefix, phrase, suffix, style — per-entity check config via [lint.rules.naming.<entity>.<check>]
COMPATcompatibility(data-driven lookup; no params)
GOOD_PRACTICES_ENGINEgood-practicesdisabled_checks, max_variable_name_length
UNSET_VARIABLES_ENGINEunset-variablesignore (variable names to ignore)
UNUSED_ENGINEunused-constructionsdisabled_checks, ignore_patterns
READABILITY_ENGINEreadabilitydisabled_checks
FORMATTING_ENGINEformattingindent_size (used by NO4LP)
PERFORMANCE_ENGINEperformanceskip_checks
CODEGEN_ENGINEcode-generationskip_checks
DEPLOYMENT_ENGINEdeploymentskip_checks
UNSUPPORTED_ENGINEunsupportedskip_checks
SYSTEM_OBJECTS_ENGINEsystem-objectsskip_checks
CONFIG_ISSUES_ENGINEconfiguration-issuesdisabled_checks
NOSEMIformattingignore_functions (calls after which a missing semicolon is tolerated)
NO4LPformattingindent_size (indent width expected for loop bodies)
SUGGESTED_IMPROVEMENTSsuggested-improvements(data-driven lookup; no params)

Complete Example ​

.malt.toml
toml
[lint]
# Skip generated and vendored code
exclude = [
    "codegen/**",
    "vendor/**",
    "*.generated.m",
]

[lint.categories]
# Keep compatibility warnings visible but don't gate the build on them
compatibility = "warn"

# Performance and formatting suggestions are noise during development
performance = "info"
formatting = "info"

[lint.rules]
# Escalate missing semicolons to errors in production code
[lint.rules.NOSEMI]
severity = "error"
ignore_functions = ["disp", "fprintf", "warning", "error", "assert"]

# Turn off a noisy sub-check of the language-spec engine
[lint.rules.LANGUAGE_SPEC_ENGINE]
disabled_checks = ["PFANSLP"]

# Raise the cyclomatic-complexity threshold for this project
[lint.rules.CUSTOM_CHECKS]
max_cyclomatic_complexity = 12

Next Steps ​

Copyright © 2026 Mark Shui Hu