Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mxcli lint

The mxcli lint command runs all lint rules (built-in Go rules and Starlark rules) against a Mendix project and reports findings.

Basic Usage

# Lint a project
mxcli lint -p app.mpr

# With colored terminal output
mxcli lint -p app.mpr --color

Output Formats

Text (Default)

Human-readable output with rule IDs, severity, and messages:

mxcli lint -p app.mpr

JSON

Machine-readable JSON output for CI integration:

mxcli lint -p app.mpr --format json

SARIF

SARIF (Static Analysis Results Interchange Format) output for GitHub Code Scanning and other SARIF-compatible tools:

mxcli lint -p app.mpr --format sarif > results.sarif

This file can be uploaded to GitHub as a code scanning result.

Options

List Available Rules

mxcli lint -p app.mpr --list-rules

Shows all available rules with their IDs, names, severity, and source (built-in or Starlark).

Exclude Modules

System and marketplace modules often trigger false positives. Exclude them:

mxcli lint -p app.mpr --exclude System --exclude Administration

Colored Output

mxcli lint -p app.mpr --color

CI Integration

GitHub Actions

- name: Lint Mendix project
  run: |
    mxcli lint -p app.mpr --format sarif > results.sarif

- name: Upload SARIF
  uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif

JSON Processing

# Count findings by severity
mxcli lint -p app.mpr --format json | jq 'group_by(.severity) | map({severity: .[0].severity, count: length})'

# Filter for errors only
mxcli lint -p app.mpr --format json | jq '[.[] | select(.severity == "error")]'

Exit Codes

CodeMeaning
0No findings
1Findings reported
2Error running linter